From: Paul Eggert Date: Thu, 4 Aug 2011 03:08:01 +0000 (-0700) Subject: * callproc.c (Fcall_process): Avoid vfork clobbering X-Git-Tag: emacs-pretest-24.0.90~104^2~124^2~65^2~4 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c74e9d8682a27211336db9745f7b4d6399929b37;p=emacs.git * callproc.c (Fcall_process): Avoid vfork clobbering the local vars buffer, coding_systems, current_dir. --- diff --git a/src/ChangeLog b/src/ChangeLog index 726ef7bce90..1ad53741533 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-08-04 Paul Eggert + + * callproc.c (Fcall_process): Avoid vfork clobbering + the local vars buffer, coding_systems, current_dir. + 2011-08-03 Stefan Monnier * keymap.c (Fmake_composed_keymap): Move to subr.el. diff --git a/src/callproc.c b/src/callproc.c index f148f6233d4..3a91be3d8da 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -603,6 +603,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) /* vfork, and prevent local vars from being clobbered by the vfork. */ { + Lisp_Object volatile buffer_volatile = buffer; + Lisp_Object volatile coding_systems_volatile = coding_systems; + Lisp_Object volatile current_dir_volatile = current_dir; int volatile fd1_volatile = fd1; int volatile fd_error_volatile = fd_error; int volatile fd_output_volatile = fd_output; @@ -611,6 +614,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) pid = vfork (); + buffer = buffer_volatile; + coding_systems = coding_systems_volatile; + current_dir = current_dir_volatile; fd1 = fd1_volatile; fd_error = fd_error_volatile; fd_output = fd_output_volatile;