+2011-02-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ don't ignore chdir failure
+ * sysdep.c (sys_subshell) [!defined DOS_NT]: Diagnose chdir
+ failure and exit.
+ (sys_subshell) [defined DOS_NT]: Mark with a FIXME the two
+ remaining unchecked chdir calls in this function; some DOS/NT
+ expert needs to fix them.
+ * emacs.c (main): Mark with a FIXME the unchecked chdir calls
+ in this function; some NextStep expert needs to fix them.
+
2011-02-05 Glenn Morris <rgm@gnu.org>
* xfaces.c (Finternal_set_lisp_face_attribute):
#ifdef NS_IMPL_COCOA
if (skip_args < argc)
{
+ /* FIXME: Do the right thing if getenv returns NULL, or if
+ chdir fails. */
if (!strncmp(argv[skip_args], "-psn", 4))
{
skip_args += 1;
sh = "sh";
/* Use our buffer's default directory for the subshell. */
- if (str)
- chdir ((char *) str);
+ if (str && chdir ((char *) str) != 0)
+ {
+#ifndef DOS_NT
+ ignore_value (write (1, "Can't chdir\n", 12));
+ _exit (1);
+#endif
+ }
close_process_descs (); /* Close Emacs's pipes/ptys */
setenv ("PWD", str, 1);
}
st = system (sh);
- chdir (oldwd);
+ chdir (oldwd); /* FIXME: Do the right thing on chdir failure. */
if (epwd)
putenv (old_pwd); /* restore previous value */
}
#ifdef WINDOWSNT
/* Waits for process completion */
pid = _spawnlp (_P_WAIT, sh, sh, NULL);
- chdir (oldwd);
+ chdir (oldwd); /* FIXME: Do the right thing on chdir failure. */
if (pid == -1)
write (1, "Can't execute subshell", 22);
#else /* not WINDOWSNT */