summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c
index f8ae50e8652..9062e6c3d6e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -318,6 +318,12 @@ static int read_process_output P_ ((Lisp_Object, int));
#define POLL_FOR_INPUT
#endif
+static Lisp_Object get_process ();
+static void exec_sentinel ();
+
+extern EMACS_TIME timer_check ();
+extern int timers_run;
+
/* Mask of bits indicating the descriptors that we wait for input on. */
static SELECT_TYPE input_wait_mask;
@@ -386,15 +392,13 @@ struct sockaddr_and_len {
#define DATAGRAM_CONN_P(proc) (0)
#endif
-static Lisp_Object get_process ();
-static void exec_sentinel ();
-
-extern EMACS_TIME timer_check ();
-extern int timers_run;
-
/* Maximum number of bytes to send to a pty without an eof. */
static int pty_max_bytes;
+/* Nonzero means don't run process sentinels. This is used
+ when exiting. */
+int inhibit_sentinels;
+
#ifdef HAVE_PTYS
#ifdef HAVE_PTY_H
#include <pty.h>
@@ -1310,6 +1314,7 @@ list_processes_1 (query_only)
register struct Lisp_Process *p;
char tembuf[300];
int w_proc, w_buffer, w_tty;
+ int exited = 0;
Lisp_Object i_status, i_buffer, i_tty, i_command;
w_proc = 4; /* Proc */
@@ -1436,8 +1441,8 @@ list_processes_1 (query_only)
}
}
- if (EQ (symbol, Qsignal) || EQ (symbol, Qexit))
- remove_process (proc);
+ if (EQ (symbol, Qsignal) || EQ (symbol, Qexit) || EQ (symbol, Qclosed))
+ exited++;
Findent_to (i_buffer, minspace);
if (NILP (p->buffer))
@@ -1501,6 +1506,8 @@ list_processes_1 (query_only)
insert_string ("\n");
}
}
+ if (exited)
+ status_notify (NULL);
return Qnil;
}
@@ -6564,6 +6571,9 @@ exec_sentinel (proc, reason)
int outer_running_asynch_code = running_asynch_code;
int waiting = waiting_for_user_input_p;
+ if (inhibit_sentinels)
+ return;
+
/* No need to gcpro these, because all we do with them later
is test them for EQness, and none of them should be a string. */
odeactivate = Vdeactivate_mark;
@@ -6885,6 +6895,8 @@ init_process ()
{
register int i;
+ inhibit_sentinels = 0;
+
#ifdef SIGCHLD
#ifndef CANNOT_DUMP
if (! noninteractive || initialized)