aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-03-09 22:10:08 +0000
committerRichard M. Stallman1994-03-09 22:10:08 +0000
commit37d541216777cc32c18b7d5daef1c90999699806 (patch)
tree1f1a5ea66070d57d654b7ac4fadd24bb0eea8669 /src
parent9f9d894124232c4028e0724abdffd01c1fb8cda7 (diff)
downloademacs-37d541216777cc32c18b7d5daef1c90999699806.tar.gz
emacs-37d541216777cc32c18b7d5daef1c90999699806.zip
Don't kill remaining processes if child exits.
(call_process_exited): New variable. (Fcall_process): Set it. (call_process_cleanup): Test it.
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/callproc.c b/src/callproc.c
index ae10f2f2012..04c2bdc7579 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -95,6 +95,13 @@ int synch_process_retcode;
95 95
96extern Lisp_Object Vdoc_file_name; 96extern Lisp_Object Vdoc_file_name;
97 97
98/* Clean up when exiting Fcall_process.
99 On MSDOS, delete the temporary file on any kind of termination.
100 On Unix, kill the process and any children on termination by signal. */
101
102/* Nonzero if this is termination due to exit. */
103static int call_process_exited;
104
98#ifndef VMS /* VMS version is in vmsproc.c. */ 105#ifndef VMS /* VMS version is in vmsproc.c. */
99 106
100static Lisp_Object 107static Lisp_Object
@@ -120,6 +127,9 @@ call_process_cleanup (fdpid)
120#else /* not MSDOS */ 127#else /* not MSDOS */
121 register int pid = XFASTINT (Fcdr (fdpid)); 128 register int pid = XFASTINT (Fcdr (fdpid));
122 129
130 if (call_process_exited)
131 return Qnil;
132
123 if (EMACS_KILLPG (pid, SIGINT) == 0) 133 if (EMACS_KILLPG (pid, SIGINT) == 0)
124 { 134 {
125 int count = specpdl_ptr - specpdl; 135 int count = specpdl_ptr - specpdl;
@@ -373,6 +383,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
373 return Qnil; 383 return Qnil;
374 } 384 }
375 385
386 call_process_exited = 0;
387
376#ifdef MSDOS 388#ifdef MSDOS
377 /* MSDOS needs different cleanup information. */ 389 /* MSDOS needs different cleanup information. */
378 record_unwind_protect (call_process_cleanup, 390 record_unwind_protect (call_process_cleanup,
@@ -417,6 +429,10 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
417 429
418 set_buffer_internal (old); 430 set_buffer_internal (old);
419 431
432 /* Don't kill any children that the subprocess may have left behind
433 when exiting. */
434 call_process_exited = 1;
435
420 unbind_to (count, Qnil); 436 unbind_to (count, Qnil);
421 437
422 if (synch_process_death) 438 if (synch_process_death)