diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-03-09 22:10:08 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-03-09 22:10:08 +0000 |
commit | 0d3100146b6d6f117b9c933991366de2f73cbfdb (patch) | |
tree | 8397219db111214ae3795e1d710b6fee43d3de12 /src/callproc.c | |
parent | 4f3240744768cb4130bce5a71c966f606f1beb03 (diff) | |
download | emacs-0d3100146b6d6f117b9c933991366de2f73cbfdb.tar.gz |
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/callproc.c')
-rw-r--r-- | src/callproc.c | 16 |
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; extern Lisp_Object Vdoc_file_name; +/* Clean up when exiting Fcall_process. + On MSDOS, delete the temporary file on any kind of termination. + On Unix, kill the process and any children on termination by signal. */ + +/* Nonzero if this is termination due to exit. */ +static int call_process_exited; + #ifndef VMS /* VMS version is in vmsproc.c. */ static Lisp_Object @@ -120,6 +127,9 @@ call_process_cleanup (fdpid) #else /* not MSDOS */ register int pid = XFASTINT (Fcdr (fdpid)); + if (call_process_exited) + return Qnil; + if (EMACS_KILLPG (pid, SIGINT) == 0) { int count = specpdl_ptr - specpdl; @@ -373,6 +383,8 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.") return Qnil; } + call_process_exited = 0; + #ifdef MSDOS /* MSDOS needs different cleanup information. */ 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.") set_buffer_internal (old); + /* Don't kill any children that the subprocess may have left behind + when exiting. */ + call_process_exited = 1; + unbind_to (count, Qnil); if (synch_process_death) |