+ /* If we can record the current working directory, we may be able
+ to do the chdir optimization. */
+ do_chdir = !save_cwd (&cwd);
+
+ /* If we've saved the cwd and DIRPATH is an absolute pathname,
+ we must chdir to `/' in order to enable the chdir optimization.
+ So if chdir ("/") fails, turn off the optimization. */
+ if (do_chdir && *dirpath == '/' && chdir ("/") < 0)
+ do_chdir = 0;
+