fp = fopen (fname, "w");
fp = fopen (fname, FOPEN_BINARY_WRITE);
fileattr_write (){    FILE *fp;    char *fname;    mode_t omask;    if (!attrs_modified)	return;    if (noexec)	return;    /* If NULL was passed to fileattr_startdir, then it isn't kosher to set       attributes.  */    assert (fileattr_stored_repos != NULL);    fname = xmalloc (strlen (fileattr_stored_repos)		     + 1		     + sizeof (CVSREP_FILEATTR)		     + 1);    strcpy (fname, fileattr_stored_repos);    strcat (fname, "/");    strcat (fname, CVSREP_FILEATTR);    if (list_isempty (attrlist) && fileattr_default_attrs == NULL)    {	/* There are no attributes.  */	if (unlink_file (fname) < 0)	{	    if (!existence_error (errno))	    {		error (0, errno, "cannot remove %s", fname);	    }	}	/* Now remove CVSREP directory, if empty.  The main reason we bother	   is that CVS 1.6 and earlier will choke if a CVSREP directory	   exists, so provide the user a graceful way to remove it.  */	strcpy (fname, fileattr_stored_repos);	strcat (fname, "/");	strcat (fname, CVSREP);	if (rmdir (fname) < 0)	{	    if (errno != ENOTEMPTY		/* Don't know why we would be here if there is no CVSREP		   directory, but it seemed to be happening anyway, so		   check for it.  */		&& !existence_error (errno))		error (0, errno, "cannot remove %s", fname);	}	free (fname);	return;    }    omask = umask (cvsumask);    fp = fopen (fname, "w");    if (fp == NULL)    {	if (existence_error (errno))	{	    /* Maybe the CVSREP directory doesn't exist.  Try creating it.  */	    char *repname;	    repname = xmalloc (strlen (fileattr_stored_repos)			       + 1			       + sizeof (CVSREP)			       + 1);	    strcpy (repname, fileattr_stored_repos);	    strcat (repname, "/");	    strcat (repname, CVSREP);	    if (CVS_MKDIR (repname, 0777) < 0 && errno != EEXIST)	    {		error (0, errno, "cannot make directory %s", repname);		(void) umask (omask);		free (repname);		return;	    }	    free (repname);	    fp = fopen (fname, "w");	}	if (fp == NULL)	{	    error (0, errno, "cannot write %s", fname);	    (void) umask (omask);	    return;	}    }    (void) umask (omask);    walklist (attrlist, writeattr_proc, fp);    if (fileattr_default_attrs != NULL)    {	fputs ("D\t", fp);	fputs (fileattr_default_attrs, fp);	fputs ("\n", fp);    }    if (fclose (fp) < 0)	error (0, errno, "cannot close %s", fname);    attrs_modified = 0;    free (fname);}