rem: err = unlink (oldname); if (dir_fd < 0 || (fdatasync (dir_fd) < 0 && fsync (dir_fd) < 0)) sync (); close (dir_fd); if (!err && flags->verbose) error (0, 0, _("%s: removed"), qoldname); return err;
add: free (dir); free (qdir); return ok;
context: wipename (char *oldname, char const *qoldname, struct Options const *flags){  char *newname, *base;	  /* Base points to filename part of newname */  unsigned len;  int first = 1;  int err;  int dir_fd;			/* Try to open directory to sync *it* */  newname = xstrdup (oldname);  if (flags->verbose)    error (0, 0, _("%s: removing"), qoldname);  /* Find the file name portion */  base = strrchr (newname, '/');  /* Temporary hackery to get a directory fd */  if (base)    {      *base = '\0';      dir_fd = open (newname, O_RDONLY | O_NOCTTY);      *base = '/';    }  else    {      dir_fd = open (".", O_RDONLY | O_NOCTTY);    }  base = base ? base + 1 : newname;  len = strlen (base);  while (len)    {      memset (base, nameset[0], len);      base[len] = 0;      do	{	  struct stat st;	  if (lstat (newname, &st) < 0)	    {	      if (rename (oldname, newname) == 0)		{		  if (dir_fd < 0		      || (fdatasync (dir_fd) < 0 && fsync (dir_fd) < 0))		    sync ();	/* Force directory out */		  if (flags->verbose)		    {		      /*		       * People seem to understand this better than talking		       * about renaming oldname.  newname doesn't need		       * quoting because we picked it.  oldname needs to		       * be quoted only the first time.		       */		      char const *old = (first ? qoldname : oldname);		      error (0, 0, _("%s: renamed to %s"), old, newname);		      first = 0;		    }		  memcpy (oldname + (base - newname), base, len + 1);		  break;		}	      else		{		  /* The rename failed: give up on this length.  */		  break;		}	    }	  else	    {	      /* newname exists, so increment BASE so we use another */	    }	}      while (!incname (base, len));      len--;    }  free (newname);  err = unlink (oldname);  if (dir_fd < 0 || (fdatasync (dir_fd) < 0 && fsync (dir_fd) < 0))    sync ();  close (dir_fd);  if (!err && flags->verbose)    error (0, 0, _("%s: removed"), qoldname);  return err;}