mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-26 07:11:34 -08:00
* sysdep.c (sys_subshell): Use 'volatile' to avoid vfork clobbering.
Before, this 'volatile' was incorrectly IF_LINTted out.
This commit is contained in:
parent
6bd8c14466
commit
7e9123a200
2 changed files with 10 additions and 2 deletions
|
|
@ -1,5 +1,8 @@
|
|||
2011-03-18 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* sysdep.c (sys_subshell): Use 'volatile' to avoid vfork clobbering.
|
||||
Before, this 'volatile' was incorrectly IF_LINTted out.
|
||||
|
||||
* lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
|
||||
This should get cleaned up, so that child_setup has the
|
||||
same signature on all platforms.
|
||||
|
|
|
|||
|
|
@ -488,7 +488,11 @@ sys_subshell (void)
|
|||
int pid;
|
||||
struct save_signal saved_handlers[5];
|
||||
Lisp_Object dir;
|
||||
unsigned char * IF_LINT (volatile) str = 0;
|
||||
|
||||
/* Volatile because otherwise vfork might clobber it on some hosts. */
|
||||
unsigned char *volatile dirstr = 0;
|
||||
|
||||
unsigned char *str;
|
||||
int len;
|
||||
|
||||
saved_handlers[0].code = SIGINT;
|
||||
|
|
@ -512,7 +516,7 @@ sys_subshell (void)
|
|||
goto xyzzy;
|
||||
|
||||
dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil);
|
||||
str = (unsigned char *) alloca (SCHARS (dir) + 2);
|
||||
str = dirstr = (unsigned char *) alloca (SCHARS (dir) + 2);
|
||||
len = SCHARS (dir);
|
||||
memcpy (str, SDATA (dir), len);
|
||||
if (str[len - 1] != '/') str[len++] = '/';
|
||||
|
|
@ -544,6 +548,7 @@ sys_subshell (void)
|
|||
sh = "sh";
|
||||
|
||||
/* Use our buffer's default directory for the subshell. */
|
||||
str = dirstr;
|
||||
if (str && chdir ((char *) str) != 0)
|
||||
{
|
||||
#ifndef DOS_NT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue