diff options
| author | Karoly Lorentey | 2006-04-10 14:52:24 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-04-10 14:52:24 +0000 |
| commit | e349ae3b6b6db99d11321622fadff88bc42c1125 (patch) | |
| tree | 7a24a5dad70d4b3695f227681fc37e179551d24a /src/process.c | |
| parent | 2518de51d20e848711c712f5030e8c207a4e2840 (diff) | |
| parent | 4f07f2e8a5458758dcf2bfbdf9b0cf8c91a8572e (diff) | |
| download | emacs-e349ae3b6b6db99d11321622fadff88bc42c1125.tar.gz emacs-e349ae3b6b6db99d11321622fadff88bc42c1125.zip | |
Merged from
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-188
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-189
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-190
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-191
Undo incorrect merge of etc/images/README from Gnus 5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-192
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-193
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-194
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-195
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-196
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-197
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-198
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-199
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-200
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-201
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-202
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-203
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-204
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-205
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-206
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-73
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-74
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-75
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-76
Update from CVS: README: Addition from 5.10.6 tar ball.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-77
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-78
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-79
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-80
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-547
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 96 |
1 files changed, 50 insertions, 46 deletions
diff --git a/src/process.c b/src/process.c index e3fa187565f..003f27b77b8 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -414,10 +414,10 @@ update_status (p) | |||
| 414 | struct Lisp_Process *p; | 414 | struct Lisp_Process *p; |
| 415 | { | 415 | { |
| 416 | union { int i; WAITTYPE wt; } u; | 416 | union { int i; WAITTYPE wt; } u; |
| 417 | u.i = XFASTINT (p->raw_status_low) + (XFASTINT (p->raw_status_high) << 16); | 417 | eassert (p->raw_status_new); |
| 418 | u.i = p->raw_status; | ||
| 418 | p->status = status_convert (u.wt); | 419 | p->status = status_convert (u.wt); |
| 419 | p->raw_status_low = Qnil; | 420 | p->raw_status_new = 0; |
| 420 | p->raw_status_high = Qnil; | ||
| 421 | } | 421 | } |
| 422 | 422 | ||
| 423 | /* Convert a process status word in Unix format to | 423 | /* Convert a process status word in Unix format to |
| @@ -619,11 +619,10 @@ make_process (name) | |||
| 619 | 619 | ||
| 620 | XSETINT (p->infd, -1); | 620 | XSETINT (p->infd, -1); |
| 621 | XSETINT (p->outfd, -1); | 621 | XSETINT (p->outfd, -1); |
| 622 | XSETFASTINT (p->pid, 0); | ||
| 623 | XSETFASTINT (p->tick, 0); | 622 | XSETFASTINT (p->tick, 0); |
| 624 | XSETFASTINT (p->update_tick, 0); | 623 | XSETFASTINT (p->update_tick, 0); |
| 625 | p->raw_status_low = Qnil; | 624 | p->pid = 0; |
| 626 | p->raw_status_high = Qnil; | 625 | p->raw_status_new = 0; |
| 627 | p->status = Qrun; | 626 | p->status = Qrun; |
| 628 | p->mark = Fmake_marker (); | 627 | p->mark = Fmake_marker (); |
| 629 | 628 | ||
| @@ -789,8 +788,7 @@ nil, indicating the current buffer's process. */) | |||
| 789 | process = get_process (process); | 788 | process = get_process (process); |
| 790 | p = XPROCESS (process); | 789 | p = XPROCESS (process); |
| 791 | 790 | ||
| 792 | p->raw_status_low = Qnil; | 791 | p->raw_status_new = 0; |
| 793 | p->raw_status_high = Qnil; | ||
| 794 | if (NETCONN1_P (p)) | 792 | if (NETCONN1_P (p)) |
| 795 | { | 793 | { |
| 796 | p->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); | 794 | p->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); |
| @@ -840,7 +838,7 @@ nil, indicating the current buffer's process. */) | |||
| 840 | return process; | 838 | return process; |
| 841 | 839 | ||
| 842 | p = XPROCESS (process); | 840 | p = XPROCESS (process); |
| 843 | if (!NILP (p->raw_status_low)) | 841 | if (p->raw_status_new) |
| 844 | update_status (p); | 842 | update_status (p); |
| 845 | status = p->status; | 843 | status = p->status; |
| 846 | if (CONSP (status)) | 844 | if (CONSP (status)) |
| @@ -865,7 +863,7 @@ If PROCESS has not yet exited or died, return 0. */) | |||
| 865 | register Lisp_Object process; | 863 | register Lisp_Object process; |
| 866 | { | 864 | { |
| 867 | CHECK_PROCESS (process); | 865 | CHECK_PROCESS (process); |
| 868 | if (!NILP (XPROCESS (process)->raw_status_low)) | 866 | if (XPROCESS (process)->raw_status_new) |
| 869 | update_status (XPROCESS (process)); | 867 | update_status (XPROCESS (process)); |
| 870 | if (CONSP (XPROCESS (process)->status)) | 868 | if (CONSP (XPROCESS (process)->status)) |
| 871 | return XCAR (XCDR (XPROCESS (process)->status)); | 869 | return XCAR (XCDR (XPROCESS (process)->status)); |
| @@ -880,7 +878,9 @@ For a network connection, this value is nil. */) | |||
| 880 | register Lisp_Object process; | 878 | register Lisp_Object process; |
| 881 | { | 879 | { |
| 882 | CHECK_PROCESS (process); | 880 | CHECK_PROCESS (process); |
| 883 | return XPROCESS (process)->pid; | 881 | return (XPROCESS (process)->pid |
| 882 | ? make_fixnum_or_float (XPROCESS (process)->pid) | ||
| 883 | : Qnil); | ||
| 884 | } | 884 | } |
| 885 | 885 | ||
| 886 | DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0, | 886 | DEFUN ("process-name", Fprocess_name, Sprocess_name, 1, 1, 0, |
| @@ -1362,7 +1362,7 @@ list_processes_1 (query_only) | |||
| 1362 | Finsert (1, &p->name); | 1362 | Finsert (1, &p->name); |
| 1363 | Findent_to (i_status, minspace); | 1363 | Findent_to (i_status, minspace); |
| 1364 | 1364 | ||
| 1365 | if (!NILP (p->raw_status_low)) | 1365 | if (p->raw_status_new) |
| 1366 | update_status (p); | 1366 | update_status (p); |
| 1367 | symbol = p->status; | 1367 | symbol = p->status; |
| 1368 | if (CONSP (p->status)) | 1368 | if (CONSP (p->status)) |
| @@ -1734,7 +1734,7 @@ start_process_unwind (proc) | |||
| 1734 | abort (); | 1734 | abort (); |
| 1735 | 1735 | ||
| 1736 | /* Was PROC started successfully? */ | 1736 | /* Was PROC started successfully? */ |
| 1737 | if (XINT (XPROCESS (proc)->pid) <= 0) | 1737 | if (XPROCESS (proc)->pid <= 0) |
| 1738 | remove_process (proc); | 1738 | remove_process (proc); |
| 1739 | 1739 | ||
| 1740 | return Qnil; | 1740 | return Qnil; |
| @@ -1945,7 +1945,7 @@ create_process (process, new_argv, current_dir) | |||
| 1945 | in the table after this function has returned; if it does | 1945 | in the table after this function has returned; if it does |
| 1946 | it might cause call-process to hang and subsequent asynchronous | 1946 | it might cause call-process to hang and subsequent asynchronous |
| 1947 | processes to get their return values scrambled. */ | 1947 | processes to get their return values scrambled. */ |
| 1948 | XSETINT (XPROCESS (process)->pid, -1); | 1948 | XPROCESS (process)->pid = -1; |
| 1949 | 1949 | ||
| 1950 | BLOCK_INPUT; | 1950 | BLOCK_INPUT; |
| 1951 | 1951 | ||
| @@ -2136,7 +2136,7 @@ create_process (process, new_argv, current_dir) | |||
| 2136 | else | 2136 | else |
| 2137 | { | 2137 | { |
| 2138 | /* vfork succeeded. */ | 2138 | /* vfork succeeded. */ |
| 2139 | XSETFASTINT (XPROCESS (process)->pid, pid); | 2139 | XPROCESS (process)->pid = pid; |
| 2140 | 2140 | ||
| 2141 | #ifdef WINDOWSNT | 2141 | #ifdef WINDOWSNT |
| 2142 | register_child (pid, inchannel); | 2142 | register_child (pid, inchannel); |
| @@ -3354,7 +3354,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3354 | p->kill_without_query = Qt; | 3354 | p->kill_without_query = Qt; |
| 3355 | if ((tem = Fplist_get (contact, QCstop), !NILP (tem))) | 3355 | if ((tem = Fplist_get (contact, QCstop), !NILP (tem))) |
| 3356 | p->command = Qt; | 3356 | p->command = Qt; |
| 3357 | p->pid = Qnil; | 3357 | p->pid = 0; |
| 3358 | XSETINT (p->infd, inch); | 3358 | XSETINT (p->infd, inch); |
| 3359 | XSETINT (p->outfd, outch); | 3359 | XSETINT (p->outfd, outch); |
| 3360 | if (is_server && socktype == SOCK_STREAM) | 3360 | if (is_server && socktype == SOCK_STREAM) |
| @@ -4070,7 +4070,7 @@ server_accept_connection (server, channel) | |||
| 4070 | p->sentinel = ps->sentinel; | 4070 | p->sentinel = ps->sentinel; |
| 4071 | p->filter = ps->filter; | 4071 | p->filter = ps->filter; |
| 4072 | p->command = Qnil; | 4072 | p->command = Qnil; |
| 4073 | p->pid = Qnil; | 4073 | p->pid = 0; |
| 4074 | XSETINT (p->infd, s); | 4074 | XSETINT (p->infd, s); |
| 4075 | XSETINT (p->outfd, s); | 4075 | XSETINT (p->outfd, s); |
| 4076 | p->status = Qrun; | 4076 | p->status = Qrun; |
| @@ -4370,9 +4370,9 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4370 | 4370 | ||
| 4371 | /* Don't wait for output from a non-running process. Just | 4371 | /* Don't wait for output from a non-running process. Just |
| 4372 | read whatever data has already been received. */ | 4372 | read whatever data has already been received. */ |
| 4373 | if (wait_proc != 0 && !NILP (wait_proc->raw_status_low)) | 4373 | if (wait_proc && wait_proc->raw_status_new) |
| 4374 | update_status (wait_proc); | 4374 | update_status (wait_proc); |
| 4375 | if (wait_proc != 0 | 4375 | if (wait_proc |
| 4376 | && ! EQ (wait_proc->status, Qrun) | 4376 | && ! EQ (wait_proc->status, Qrun) |
| 4377 | && ! EQ (wait_proc->status, Qconnect)) | 4377 | && ! EQ (wait_proc->status, Qconnect)) |
| 4378 | { | 4378 | { |
| @@ -4756,7 +4756,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4756 | /* Preserve status of processes already terminated. */ | 4756 | /* Preserve status of processes already terminated. */ |
| 4757 | XSETINT (XPROCESS (proc)->tick, ++process_tick); | 4757 | XSETINT (XPROCESS (proc)->tick, ++process_tick); |
| 4758 | deactivate_process (proc); | 4758 | deactivate_process (proc); |
| 4759 | if (!NILP (XPROCESS (proc)->raw_status_low)) | 4759 | if (XPROCESS (proc)->raw_status_new) |
| 4760 | update_status (XPROCESS (proc)); | 4760 | update_status (XPROCESS (proc)); |
| 4761 | if (EQ (XPROCESS (proc)->status, Qrun)) | 4761 | if (EQ (XPROCESS (proc)->status, Qrun)) |
| 4762 | XPROCESS (proc)->status | 4762 | XPROCESS (proc)->status |
| @@ -5293,7 +5293,7 @@ send_process (proc, buf, len, object) | |||
| 5293 | VMS_PROC_STUFF *vs, *get_vms_process_pointer(); | 5293 | VMS_PROC_STUFF *vs, *get_vms_process_pointer(); |
| 5294 | #endif /* VMS */ | 5294 | #endif /* VMS */ |
| 5295 | 5295 | ||
| 5296 | if (! NILP (p->raw_status_low)) | 5296 | if (p->raw_status_new) |
| 5297 | update_status (p); | 5297 | update_status (p); |
| 5298 | if (! EQ (p->status, Qrun)) | 5298 | if (! EQ (p->status, Qrun)) |
| 5299 | error ("Process %s not running", SDATA (p->name)); | 5299 | error ("Process %s not running", SDATA (p->name)); |
| @@ -5557,8 +5557,7 @@ send_process (proc, buf, len, object) | |||
| 5557 | proc = process_sent_to; | 5557 | proc = process_sent_to; |
| 5558 | p = XPROCESS (proc); | 5558 | p = XPROCESS (proc); |
| 5559 | #endif | 5559 | #endif |
| 5560 | p->raw_status_low = Qnil; | 5560 | p->raw_status_new = 0; |
| 5561 | p->raw_status_high = Qnil; | ||
| 5562 | p->status = Fcons (Qexit, Fcons (make_number (256), Qnil)); | 5561 | p->status = Fcons (Qexit, Fcons (make_number (256), Qnil)); |
| 5563 | XSETINT (p->tick, ++process_tick); | 5562 | XSETINT (p->tick, ++process_tick); |
| 5564 | deactivate_process (proc); | 5563 | deactivate_process (proc); |
| @@ -5673,7 +5672,7 @@ return t unconditionally. */) | |||
| 5673 | 5672 | ||
| 5674 | gid = emacs_get_tty_pgrp (p); | 5673 | gid = emacs_get_tty_pgrp (p); |
| 5675 | 5674 | ||
| 5676 | if (gid == XFASTINT (p->pid)) | 5675 | if (gid == p->pid) |
| 5677 | return Qnil; | 5676 | return Qnil; |
| 5678 | return Qt; | 5677 | return Qt; |
| 5679 | } | 5678 | } |
| @@ -5720,7 +5719,7 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5720 | /* If we are using pgrps, get a pgrp number and make it negative. */ | 5719 | /* If we are using pgrps, get a pgrp number and make it negative. */ |
| 5721 | if (NILP (current_group)) | 5720 | if (NILP (current_group)) |
| 5722 | /* Send the signal to the shell's process group. */ | 5721 | /* Send the signal to the shell's process group. */ |
| 5723 | gid = XFASTINT (p->pid); | 5722 | gid = p->pid; |
| 5724 | else | 5723 | else |
| 5725 | { | 5724 | { |
| 5726 | #ifdef SIGNALS_VIA_CHARACTERS | 5725 | #ifdef SIGNALS_VIA_CHARACTERS |
| @@ -5839,7 +5838,7 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5839 | if (gid == -1) | 5838 | if (gid == -1) |
| 5840 | /* If we can't get the information, assume | 5839 | /* If we can't get the information, assume |
| 5841 | the shell owns the tty. */ | 5840 | the shell owns the tty. */ |
| 5842 | gid = XFASTINT (p->pid); | 5841 | gid = p->pid; |
| 5843 | 5842 | ||
| 5844 | /* It is not clear whether anything really can set GID to -1. | 5843 | /* It is not clear whether anything really can set GID to -1. |
| 5845 | Perhaps on some system one of those ioctls can or could do so. | 5844 | Perhaps on some system one of those ioctls can or could do so. |
| @@ -5849,12 +5848,12 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5849 | #else /* ! defined (TIOCGPGRP ) */ | 5848 | #else /* ! defined (TIOCGPGRP ) */ |
| 5850 | /* Can't select pgrps on this system, so we know that | 5849 | /* Can't select pgrps on this system, so we know that |
| 5851 | the child itself heads the pgrp. */ | 5850 | the child itself heads the pgrp. */ |
| 5852 | gid = XFASTINT (p->pid); | 5851 | gid = p->pid; |
| 5853 | #endif /* ! defined (TIOCGPGRP ) */ | 5852 | #endif /* ! defined (TIOCGPGRP ) */ |
| 5854 | 5853 | ||
| 5855 | /* If current_group is lambda, and the shell owns the terminal, | 5854 | /* If current_group is lambda, and the shell owns the terminal, |
| 5856 | don't send any signal. */ | 5855 | don't send any signal. */ |
| 5857 | if (EQ (current_group, Qlambda) && gid == XFASTINT (p->pid)) | 5856 | if (EQ (current_group, Qlambda) && gid == p->pid) |
| 5858 | return; | 5857 | return; |
| 5859 | } | 5858 | } |
| 5860 | 5859 | ||
| @@ -5862,8 +5861,7 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5862 | { | 5861 | { |
| 5863 | #ifdef SIGCONT | 5862 | #ifdef SIGCONT |
| 5864 | case SIGCONT: | 5863 | case SIGCONT: |
| 5865 | p->raw_status_low = Qnil; | 5864 | p->raw_status_new = 0; |
| 5866 | p->raw_status_high = Qnil; | ||
| 5867 | p->status = Qrun; | 5865 | p->status = Qrun; |
| 5868 | XSETINT (p->tick, ++process_tick); | 5866 | XSETINT (p->tick, ++process_tick); |
| 5869 | if (!nomsg) | 5867 | if (!nomsg) |
| @@ -5882,7 +5880,7 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5882 | #endif | 5880 | #endif |
| 5883 | case SIGKILL: | 5881 | case SIGKILL: |
| 5884 | #ifdef VMS | 5882 | #ifdef VMS |
| 5885 | sys$forcex (&(XFASTINT (p->pid)), 0, 1); | 5883 | sys$forcex (&(p->pid), 0, 1); |
| 5886 | whoosh: | 5884 | whoosh: |
| 5887 | #endif | 5885 | #endif |
| 5888 | flush_pending_output (XINT (p->infd)); | 5886 | flush_pending_output (XINT (p->infd)); |
| @@ -5894,7 +5892,7 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5894 | obvious alternative. */ | 5892 | obvious alternative. */ |
| 5895 | if (no_pgrp) | 5893 | if (no_pgrp) |
| 5896 | { | 5894 | { |
| 5897 | kill (XFASTINT (p->pid), signo); | 5895 | kill (p->pid, signo); |
| 5898 | return; | 5896 | return; |
| 5899 | } | 5897 | } |
| 5900 | 5898 | ||
| @@ -5907,7 +5905,7 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5907 | } | 5905 | } |
| 5908 | else | 5906 | else |
| 5909 | { | 5907 | { |
| 5910 | gid = - XFASTINT (p->pid); | 5908 | gid = - p->pid; |
| 5911 | kill (gid, signo); | 5909 | kill (gid, signo); |
| 5912 | } | 5910 | } |
| 5913 | #else /* ! defined (TIOCSIGSEND) */ | 5911 | #else /* ! defined (TIOCSIGSEND) */ |
| @@ -6027,11 +6025,17 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */) | |||
| 6027 | (process, sigcode) | 6025 | (process, sigcode) |
| 6028 | Lisp_Object process, sigcode; | 6026 | Lisp_Object process, sigcode; |
| 6029 | { | 6027 | { |
| 6030 | Lisp_Object pid; | 6028 | pid_t pid; |
| 6031 | 6029 | ||
| 6032 | if (INTEGERP (process)) | 6030 | if (INTEGERP (process)) |
| 6033 | { | 6031 | { |
| 6034 | pid = process; | 6032 | pid = XINT (process); |
| 6033 | goto got_it; | ||
| 6034 | } | ||
| 6035 | |||
| 6036 | if (FLOATP (process)) | ||
| 6037 | { | ||
| 6038 | pid = (pid_t) XFLOAT (process); | ||
| 6035 | goto got_it; | 6039 | goto got_it; |
| 6036 | } | 6040 | } |
| 6037 | 6041 | ||
| @@ -6040,8 +6044,8 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */) | |||
| 6040 | Lisp_Object tem; | 6044 | Lisp_Object tem; |
| 6041 | if (tem = Fget_process (process), NILP (tem)) | 6045 | if (tem = Fget_process (process), NILP (tem)) |
| 6042 | { | 6046 | { |
| 6043 | pid = Fstring_to_number (process, make_number (10)); | 6047 | pid = XINT (Fstring_to_number (process, make_number (10))); |
| 6044 | if (XINT (pid) != 0) | 6048 | if (pid > 0) |
| 6045 | goto got_it; | 6049 | goto got_it; |
| 6046 | } | 6050 | } |
| 6047 | process = tem; | 6051 | process = tem; |
| @@ -6054,7 +6058,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */) | |||
| 6054 | 6058 | ||
| 6055 | CHECK_PROCESS (process); | 6059 | CHECK_PROCESS (process); |
| 6056 | pid = XPROCESS (process)->pid; | 6060 | pid = XPROCESS (process)->pid; |
| 6057 | if (!INTEGERP (pid) || XINT (pid) <= 0) | 6061 | if (pid <= 0) |
| 6058 | error ("Cannot signal process %s", SDATA (XPROCESS (process)->name)); | 6062 | error ("Cannot signal process %s", SDATA (XPROCESS (process)->name)); |
| 6059 | 6063 | ||
| 6060 | got_it: | 6064 | got_it: |
| @@ -6173,7 +6177,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */) | |||
| 6173 | 6177 | ||
| 6174 | #undef handle_signal | 6178 | #undef handle_signal |
| 6175 | 6179 | ||
| 6176 | return make_number (kill (XINT (pid), XINT (sigcode))); | 6180 | return make_number (kill (pid, XINT (sigcode))); |
| 6177 | } | 6181 | } |
| 6178 | 6182 | ||
| 6179 | DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0, | 6183 | DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0, |
| @@ -6197,7 +6201,7 @@ text to PROCESS after you call this function. */) | |||
| 6197 | coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)]; | 6201 | coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)]; |
| 6198 | 6202 | ||
| 6199 | /* Make sure the process is really alive. */ | 6203 | /* Make sure the process is really alive. */ |
| 6200 | if (! NILP (XPROCESS (proc)->raw_status_low)) | 6204 | if (XPROCESS (proc)->raw_status_new) |
| 6201 | update_status (XPROCESS (proc)); | 6205 | update_status (XPROCESS (proc)); |
| 6202 | if (! EQ (XPROCESS (proc)->status, Qrun)) | 6206 | if (! EQ (XPROCESS (proc)->status, Qrun)) |
| 6203 | error ("Process %s not running", SDATA (XPROCESS (proc)->name)); | 6207 | error ("Process %s not running", SDATA (XPROCESS (proc)->name)); |
| @@ -6222,7 +6226,7 @@ text to PROCESS after you call this function. */) | |||
| 6222 | for communication with the subprocess, call shutdown to cause EOF. | 6226 | for communication with the subprocess, call shutdown to cause EOF. |
| 6223 | (In some old system, shutdown to socketpair doesn't work. | 6227 | (In some old system, shutdown to socketpair doesn't work. |
| 6224 | Then we just can't win.) */ | 6228 | Then we just can't win.) */ |
| 6225 | if (NILP (XPROCESS (proc)->pid) | 6229 | if (XPROCESS (proc)->pid == 0 |
| 6226 | || XINT (XPROCESS (proc)->outfd) == XINT (XPROCESS (proc)->infd)) | 6230 | || XINT (XPROCESS (proc)->outfd) == XINT (XPROCESS (proc)->infd)) |
| 6227 | shutdown (XINT (XPROCESS (proc)->outfd), 1); | 6231 | shutdown (XINT (XPROCESS (proc)->outfd), 1); |
| 6228 | /* In case of socketpair, outfd == infd, so don't close it. */ | 6232 | /* In case of socketpair, outfd == infd, so don't close it. */ |
| @@ -6359,7 +6363,7 @@ sigchld_handler (signo) | |||
| 6359 | { | 6363 | { |
| 6360 | proc = XCDR (XCAR (tail)); | 6364 | proc = XCDR (XCAR (tail)); |
| 6361 | p = XPROCESS (proc); | 6365 | p = XPROCESS (proc); |
| 6362 | if (GC_EQ (p->childp, Qt) && XINT (p->pid) == pid) | 6366 | if (GC_EQ (p->childp, Qt) && p->pid == pid) |
| 6363 | break; | 6367 | break; |
| 6364 | p = 0; | 6368 | p = 0; |
| 6365 | } | 6369 | } |
| @@ -6371,7 +6375,7 @@ sigchld_handler (signo) | |||
| 6371 | { | 6375 | { |
| 6372 | proc = XCDR (XCAR (tail)); | 6376 | proc = XCDR (XCAR (tail)); |
| 6373 | p = XPROCESS (proc); | 6377 | p = XPROCESS (proc); |
| 6374 | if (GC_INTEGERP (p->pid) && XINT (p->pid) == -1) | 6378 | if (p->pid == -1) |
| 6375 | break; | 6379 | break; |
| 6376 | p = 0; | 6380 | p = 0; |
| 6377 | } | 6381 | } |
| @@ -6384,8 +6388,8 @@ sigchld_handler (signo) | |||
| 6384 | 6388 | ||
| 6385 | XSETINT (p->tick, ++process_tick); | 6389 | XSETINT (p->tick, ++process_tick); |
| 6386 | u.wt = w; | 6390 | u.wt = w; |
| 6387 | XSETINT (p->raw_status_low, u.i & 0xffff); | 6391 | p->raw_status = u.i; |
| 6388 | XSETINT (p->raw_status_high, u.i >> 16); | 6392 | p->raw_status_new = 1; |
| 6389 | 6393 | ||
| 6390 | /* If process has terminated, stop waiting for its output. */ | 6394 | /* If process has terminated, stop waiting for its output. */ |
| 6391 | if ((WIFSIGNALED (w) || WIFEXITED (w)) | 6395 | if ((WIFSIGNALED (w) || WIFEXITED (w)) |
| @@ -6582,7 +6586,7 @@ status_notify (deleting_process) | |||
| 6582 | buffer = p->buffer; | 6586 | buffer = p->buffer; |
| 6583 | 6587 | ||
| 6584 | /* Get the text to use for the message. */ | 6588 | /* Get the text to use for the message. */ |
| 6585 | if (!NILP (p->raw_status_low)) | 6589 | if (p->raw_status_new) |
| 6586 | update_status (p); | 6590 | update_status (p); |
| 6587 | msg = status_message (p); | 6591 | msg = status_message (p); |
| 6588 | 6592 | ||