aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog3
-rw-r--r--src/sysdep.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index da9676233e0..53f66bd8032 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12011-03-18 Paul Eggert <eggert@cs.ucla.edu> 12011-03-18 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * sysdep.c (sys_subshell): Use 'volatile' to avoid vfork clobbering.
4 Before, this 'volatile' was incorrectly IF_LINTted out.
5
3 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT. 6 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
4 This should get cleaned up, so that child_setup has the 7 This should get cleaned up, so that child_setup has the
5 same signature on all platforms. 8 same signature on all platforms.
diff --git a/src/sysdep.c b/src/sysdep.c
index 6ef3d88c5c8..889ff6d83eb 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -488,7 +488,11 @@ sys_subshell (void)
488 int pid; 488 int pid;
489 struct save_signal saved_handlers[5]; 489 struct save_signal saved_handlers[5];
490 Lisp_Object dir; 490 Lisp_Object dir;
491 unsigned char * IF_LINT (volatile) str = 0; 491
492 /* Volatile because otherwise vfork might clobber it on some hosts. */
493 unsigned char *volatile dirstr = 0;
494
495 unsigned char *str;
492 int len; 496 int len;
493 497
494 saved_handlers[0].code = SIGINT; 498 saved_handlers[0].code = SIGINT;
@@ -512,7 +516,7 @@ sys_subshell (void)
512 goto xyzzy; 516 goto xyzzy;
513 517
514 dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil); 518 dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil);
515 str = (unsigned char *) alloca (SCHARS (dir) + 2); 519 str = dirstr = (unsigned char *) alloca (SCHARS (dir) + 2);
516 len = SCHARS (dir); 520 len = SCHARS (dir);
517 memcpy (str, SDATA (dir), len); 521 memcpy (str, SDATA (dir), len);
518 if (str[len - 1] != '/') str[len++] = '/'; 522 if (str[len - 1] != '/') str[len++] = '/';
@@ -544,6 +548,7 @@ sys_subshell (void)
544 sh = "sh"; 548 sh = "sh";
545 549
546 /* Use our buffer's default directory for the subshell. */ 550 /* Use our buffer's default directory for the subshell. */
551 str = dirstr;
547 if (str && chdir ((char *) str) != 0) 552 if (str && chdir ((char *) str) != 0)
548 { 553 {
549#ifndef DOS_NT 554#ifndef DOS_NT