rem: if (fchdir (cwd->desc))
add: if (fchdir_needs_testing && fchdir (cwd->desc) != 0)
context: save_cwd (struct saved_cwd *cwd){  static int have_working_fchdir = 1;  cwd->desc = -1;  cwd->name = NULL;  if (have_working_fchdir)    {#if HAVE_FCHDIR      cwd->desc = open (".", O_RDONLY | O_DIRECTORY);      if (cwd->desc < 0)	{	  error (0, errno, "cannot open current directory");	  return 1;	}# if __sun__ || sun      /* On SunOS 4 and IRIX 5.3, fchdir returns EINVAL when auditing	 is enabled, so we have to fall back to chdir.  */      if (fchdir (cwd->desc))	{	  if (errno == EINVAL)	    {	      close (cwd->desc);	      cwd->desc = -1;	      have_working_fchdir = 0;	    }	  else	    {	      error (0, errno, "current directory");	      close (cwd->desc);	      cwd->desc = -1;	      return 1;	    }	}# endif /* __sun__ || sun */#else# define fchdir(x) (abort (), 0)      have_working_fchdir = 0;#endif    }  if (!have_working_fchdir)    {      cwd->name = xgetcwd ();      if (cwd->name == NULL)	{	  error (0, errno, "cannot get current directory");	  return 1;	}    }  return 0;}