/[emacs]/emacs/src/process.c
ViewVC logotype

Diff of /emacs/src/process.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.430 by friedman, Fri May 28 21:58:31 2004 UTC revision 1.431 by kfstorm, Sun Jun 6 22:17:53 2004 UTC
# Line 445  decode_status (l, symbol, code, coredump Line 445  decode_status (l, symbol, code, coredump
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;
# Line 469  status_message (status) Line 470  status_message (status)
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));
# Line 764  nil, indicating the current buffer's pro Line 767  nil, indicating the current buffer's pro
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      {      {
# Line 774  nil, indicating the current buffer's pro Line 778  nil, indicating the current buffer's pro
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    
# Line 4703  read_process_output_error_handler (error Line 4696  read_process_output_error_handler (error
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    
# Line 4723  read_process_output (proc, channel) Line 4716  read_process_output (proc, channel)
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();
# Line 4756  read_process_output (proc, channel) Line 4749  read_process_output (proc, channel)
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.  */
# Line 6399  status_notify () Line 6382  status_notify ()
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;

Legend:
Removed from v.1.430  
changed lines
  Added in v.1.431

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26