aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorPaul Eggert2011-03-19 20:07:54 -0700
committerPaul Eggert2011-03-19 20:07:54 -0700
commit12d8b6ab59c4a70a7af46361dc4ff05308982a54 (patch)
tree437b36c087c008510a8b3e47d5f6ed7389ea8029 /src/process.c
parent7b8081265e19732eb3e0defde970e1ccfad5fbcc (diff)
downloademacs-12d8b6ab59c4a70a7af46361dc4ff05308982a54.tar.gz
emacs-12d8b6ab59c4a70a7af46361dc4ff05308982a54.zip
* process.c (create_process): Use 'volatile' to avoid vfork clobbering.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/process.c b/src/process.c
index 5bc1707756b..5ee731a5bd3 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1912,8 +1912,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1912 /* child_setup must clobber environ on systems with true vfork. 1912 /* child_setup must clobber environ on systems with true vfork.
1913 Protect it from permanent change. */ 1913 Protect it from permanent change. */
1914 char **save_environ = environ; 1914 char **save_environ = environ;
1915 1915 volatile Lisp_Object encoded_current_dir = ENCODE_FILE (current_dir);
1916 current_dir = ENCODE_FILE (current_dir);
1917 1916
1918#ifndef WINDOWSNT 1917#ifndef WINDOWSNT
1919 pid = vfork (); 1918 pid = vfork ();
@@ -2054,13 +2053,13 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
2054 child_setup_tty (xforkout); 2053 child_setup_tty (xforkout);
2055#ifdef WINDOWSNT 2054#ifdef WINDOWSNT
2056 pid = child_setup (xforkin, xforkout, xforkout, 2055 pid = child_setup (xforkin, xforkout, xforkout,
2057 new_argv, 1, current_dir); 2056 new_argv, 1, encoded_current_dir);
2058#else /* not WINDOWSNT */ 2057#else /* not WINDOWSNT */
2059#ifdef FD_CLOEXEC 2058#ifdef FD_CLOEXEC
2060 emacs_close (wait_child_setup[0]); 2059 emacs_close (wait_child_setup[0]);
2061#endif 2060#endif
2062 child_setup (xforkin, xforkout, xforkout, 2061 child_setup (xforkin, xforkout, xforkout,
2063 new_argv, 1, current_dir); 2062 new_argv, 1, encoded_current_dir);
2064#endif /* not WINDOWSNT */ 2063#endif /* not WINDOWSNT */
2065 } 2064 }
2066 environ = save_environ; 2065 environ = save_environ;