Mercurial > emacs
changeset 55962:8979bc3ade70
(Fdelete_process): Undo 2004-05-28 change.
Instead, call status_notify also for network process.
(status_message): Use process instead of status as arg.
Give messages "deleted" or "connection broken by remote peer" for
an exited network process.
(status_notify): Change call to status_message.
(read_process_output): Increase readmax to 4096. Do not increase
buffer size for datagram channels (default is now large enough).
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sun, 06 Jun 2004 22:17:53 +0000 |
parents | e090d01739be |
children | e2a4206075f9 |
files | src/process.c |
diffstat | 1 files changed, 11 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/process.c Sun Jun 06 22:15:12 2004 +0000 +++ b/src/process.c Sun Jun 06 22:17:53 2004 +0000 @@ -445,10 +445,11 @@ /* Return a string describing a process status list. */ -Lisp_Object -status_message (status) - Lisp_Object status; +static Lisp_Object +status_message (p) + struct Lisp_Process *p; { + Lisp_Object status = p->status; Lisp_Object symbol; int code, coredump; Lisp_Object string, string2; @@ -469,6 +470,8 @@ } else if (EQ (symbol, Qexit)) { + if (NETCONN1_P (p)) + return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n"); if (code == 0) return build_string ("finished\n"); string = Fnumber_to_string (make_number (code)); @@ -764,6 +767,7 @@ { XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); XSETINT (XPROCESS (process)->tick, ++process_tick); + status_notify (); } else if (XINT (XPROCESS (process)->infd) >= 0) { @@ -774,18 +778,7 @@ XSETINT (XPROCESS (process)->tick, ++process_tick); status_notify (); } - /* Do not call remove_process here; either status_notify has already done - it, or will do so the next time emacs polls for input. Thus network - processes are not immediately removed, and their sentinel will be - called. - - Since Fdelete_process is called by kill_buffer_processes, this also - means that a network process sentinel will run after the buffer is - dead, which would not be the case if status_notify() were called - unconditionally here. This way process sentinels observe consistent - behavior with regard to buffer-live-p. - */ - /* remove_process (process); */ + remove_process (process); return Qnil; } @@ -4703,7 +4696,7 @@ starting with our buffered-ahead character if we have one. Yield number of decoded characters read. - This function reads at most 1024 characters. + This function reads at most 4096 characters. If you want to read all available subprocess output, you must call it repeatedly until it returns zero. @@ -4723,7 +4716,7 @@ register int opoint; struct coding_system *coding = proc_decode_coding_system[channel]; int carryover = XINT (p->decoding_carryover); - int readmax = 1024; + int readmax = 4096; #ifdef VMS VMS_PROC_STUFF *vs, *get_vms_process_pointer(); @@ -4756,16 +4749,6 @@ } #else /* not VMS */ -#ifdef DATAGRAM_SOCKETS - /* A datagram is one packet; allow at least 1500+ bytes of data - corresponding to the typical Ethernet frame size. */ - if (DATAGRAM_CHAN_P (channel)) - { - /* carryover = 0; */ /* Does carryover make sense for datagrams? */ - readmax += 1024; - } -#endif - chars = (char *) alloca (carryover + readmax); if (carryover) /* See the comment above. */ @@ -6399,7 +6382,7 @@ /* Get the text to use for the message. */ if (!NILP (p->raw_status_low)) update_status (p); - msg = status_message (p->status); + msg = status_message (p); /* If process is terminated, deactivate it or delete it. */ symbol = p->status;