445 |
|
|
446 |
/* Return a string describing a process status list. */ |
/* Return a string describing a process status list. */ |
447 |
|
|
448 |
Lisp_Object |
static Lisp_Object |
449 |
status_message (status) |
status_message (p) |
450 |
Lisp_Object status; |
struct Lisp_Process *p; |
451 |
{ |
{ |
452 |
|
Lisp_Object status = p->status; |
453 |
Lisp_Object symbol; |
Lisp_Object symbol; |
454 |
int code, coredump; |
int code, coredump; |
455 |
Lisp_Object string, string2; |
Lisp_Object string, string2; |
470 |
} |
} |
471 |
else if (EQ (symbol, Qexit)) |
else if (EQ (symbol, Qexit)) |
472 |
{ |
{ |
473 |
|
if (NETCONN1_P (p)) |
474 |
|
return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n"); |
475 |
if (code == 0) |
if (code == 0) |
476 |
return build_string ("finished\n"); |
return build_string ("finished\n"); |
477 |
string = Fnumber_to_string (make_number (code)); |
string = Fnumber_to_string (make_number (code)); |
767 |
{ |
{ |
768 |
XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); |
XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); |
769 |
XSETINT (XPROCESS (process)->tick, ++process_tick); |
XSETINT (XPROCESS (process)->tick, ++process_tick); |
770 |
|
status_notify (); |
771 |
} |
} |
772 |
else if (XINT (XPROCESS (process)->infd) >= 0) |
else if (XINT (XPROCESS (process)->infd) >= 0) |
773 |
{ |
{ |
778 |
XSETINT (XPROCESS (process)->tick, ++process_tick); |
XSETINT (XPROCESS (process)->tick, ++process_tick); |
779 |
status_notify (); |
status_notify (); |
780 |
} |
} |
781 |
/* Do not call remove_process here; either status_notify has already done |
remove_process (process); |
|
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); */ |
|
782 |
return Qnil; |
return Qnil; |
783 |
} |
} |
784 |
|
|
4696 |
starting with our buffered-ahead character if we have one. |
starting with our buffered-ahead character if we have one. |
4697 |
Yield number of decoded characters read. |
Yield number of decoded characters read. |
4698 |
|
|
4699 |
This function reads at most 1024 characters. |
This function reads at most 4096 characters. |
4700 |
If you want to read all available subprocess output, |
If you want to read all available subprocess output, |
4701 |
you must call it repeatedly until it returns zero. |
you must call it repeatedly until it returns zero. |
4702 |
|
|
4716 |
register int opoint; |
register int opoint; |
4717 |
struct coding_system *coding = proc_decode_coding_system[channel]; |
struct coding_system *coding = proc_decode_coding_system[channel]; |
4718 |
int carryover = XINT (p->decoding_carryover); |
int carryover = XINT (p->decoding_carryover); |
4719 |
int readmax = 1024; |
int readmax = 4096; |
4720 |
|
|
4721 |
#ifdef VMS |
#ifdef VMS |
4722 |
VMS_PROC_STUFF *vs, *get_vms_process_pointer(); |
VMS_PROC_STUFF *vs, *get_vms_process_pointer(); |
4749 |
} |
} |
4750 |
#else /* not VMS */ |
#else /* not VMS */ |
4751 |
|
|
|
#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 |
|
|
|
|
4752 |
chars = (char *) alloca (carryover + readmax); |
chars = (char *) alloca (carryover + readmax); |
4753 |
if (carryover) |
if (carryover) |
4754 |
/* See the comment above. */ |
/* See the comment above. */ |
6382 |
/* Get the text to use for the message. */ |
/* Get the text to use for the message. */ |
6383 |
if (!NILP (p->raw_status_low)) |
if (!NILP (p->raw_status_low)) |
6384 |
update_status (p); |
update_status (p); |
6385 |
msg = status_message (p->status); |
msg = status_message (p); |
6386 |
|
|
6387 |
/* If process is terminated, deactivate it or delete it. */ |
/* If process is terminated, deactivate it or delete it. */ |
6388 |
symbol = p->status; |
symbol = p->status; |