diff options
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 28 |
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)); | |||
| 318 | #define POLL_FOR_INPUT | 318 | #define POLL_FOR_INPUT |
| 319 | #endif | 319 | #endif |
| 320 | 320 | ||
| 321 | static Lisp_Object get_process (); | ||
| 322 | static void exec_sentinel (); | ||
| 323 | |||
| 324 | extern EMACS_TIME timer_check (); | ||
| 325 | extern int timers_run; | ||
| 326 | |||
| 321 | /* Mask of bits indicating the descriptors that we wait for input on. */ | 327 | /* Mask of bits indicating the descriptors that we wait for input on. */ |
| 322 | 328 | ||
| 323 | static SELECT_TYPE input_wait_mask; | 329 | static SELECT_TYPE input_wait_mask; |
| @@ -386,15 +392,13 @@ struct sockaddr_and_len { | |||
| 386 | #define DATAGRAM_CONN_P(proc) (0) | 392 | #define DATAGRAM_CONN_P(proc) (0) |
| 387 | #endif | 393 | #endif |
| 388 | 394 | ||
| 389 | static Lisp_Object get_process (); | ||
| 390 | static void exec_sentinel (); | ||
| 391 | |||
| 392 | extern EMACS_TIME timer_check (); | ||
| 393 | extern int timers_run; | ||
| 394 | |||
| 395 | /* Maximum number of bytes to send to a pty without an eof. */ | 395 | /* Maximum number of bytes to send to a pty without an eof. */ |
| 396 | static int pty_max_bytes; | 396 | static int pty_max_bytes; |
| 397 | 397 | ||
| 398 | /* Nonzero means don't run process sentinels. This is used | ||
| 399 | when exiting. */ | ||
| 400 | int inhibit_sentinels; | ||
| 401 | |||
| 398 | #ifdef HAVE_PTYS | 402 | #ifdef HAVE_PTYS |
| 399 | #ifdef HAVE_PTY_H | 403 | #ifdef HAVE_PTY_H |
| 400 | #include <pty.h> | 404 | #include <pty.h> |
| @@ -1310,6 +1314,7 @@ list_processes_1 (query_only) | |||
| 1310 | register struct Lisp_Process *p; | 1314 | register struct Lisp_Process *p; |
| 1311 | char tembuf[300]; | 1315 | char tembuf[300]; |
| 1312 | int w_proc, w_buffer, w_tty; | 1316 | int w_proc, w_buffer, w_tty; |
| 1317 | int exited = 0; | ||
| 1313 | Lisp_Object i_status, i_buffer, i_tty, i_command; | 1318 | Lisp_Object i_status, i_buffer, i_tty, i_command; |
| 1314 | 1319 | ||
| 1315 | w_proc = 4; /* Proc */ | 1320 | w_proc = 4; /* Proc */ |
| @@ -1436,8 +1441,8 @@ list_processes_1 (query_only) | |||
| 1436 | } | 1441 | } |
| 1437 | } | 1442 | } |
| 1438 | 1443 | ||
| 1439 | if (EQ (symbol, Qsignal) || EQ (symbol, Qexit)) | 1444 | if (EQ (symbol, Qsignal) || EQ (symbol, Qexit) || EQ (symbol, Qclosed)) |
| 1440 | remove_process (proc); | 1445 | exited++; |
| 1441 | 1446 | ||
| 1442 | Findent_to (i_buffer, minspace); | 1447 | Findent_to (i_buffer, minspace); |
| 1443 | if (NILP (p->buffer)) | 1448 | if (NILP (p->buffer)) |
| @@ -1501,6 +1506,8 @@ list_processes_1 (query_only) | |||
| 1501 | insert_string ("\n"); | 1506 | insert_string ("\n"); |
| 1502 | } | 1507 | } |
| 1503 | } | 1508 | } |
| 1509 | if (exited) | ||
| 1510 | status_notify (NULL); | ||
| 1504 | return Qnil; | 1511 | return Qnil; |
| 1505 | } | 1512 | } |
| 1506 | 1513 | ||
| @@ -6564,6 +6571,9 @@ exec_sentinel (proc, reason) | |||
| 6564 | int outer_running_asynch_code = running_asynch_code; | 6571 | int outer_running_asynch_code = running_asynch_code; |
| 6565 | int waiting = waiting_for_user_input_p; | 6572 | int waiting = waiting_for_user_input_p; |
| 6566 | 6573 | ||
| 6574 | if (inhibit_sentinels) | ||
| 6575 | return; | ||
| 6576 | |||
| 6567 | /* No need to gcpro these, because all we do with them later | 6577 | /* No need to gcpro these, because all we do with them later |
| 6568 | is test them for EQness, and none of them should be a string. */ | 6578 | is test them for EQness, and none of them should be a string. */ |
| 6569 | odeactivate = Vdeactivate_mark; | 6579 | odeactivate = Vdeactivate_mark; |
| @@ -6885,6 +6895,8 @@ init_process () | |||
| 6885 | { | 6895 | { |
| 6886 | register int i; | 6896 | register int i; |
| 6887 | 6897 | ||
| 6898 | inhibit_sentinels = 0; | ||
| 6899 | |||
| 6888 | #ifdef SIGCHLD | 6900 | #ifdef SIGCHLD |
| 6889 | #ifndef CANNOT_DUMP | 6901 | #ifndef CANNOT_DUMP |
| 6890 | if (! noninteractive || initialized) | 6902 | if (! noninteractive || initialized) |