aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorJuanma Barranquero2003-02-04 14:56:31 +0000
committerJuanma Barranquero2003-02-04 14:56:31 +0000
commit177c0ea74342272645959b82cf219faa0b3dba16 (patch)
tree44e22b210a9904eab25a66d12e708804b671df75 /src/process.c
parentdb95369be096960245dd38678f68464627698678 (diff)
downloademacs-177c0ea74342272645959b82cf219faa0b3dba16.tar.gz
emacs-177c0ea74342272645959b82cf219faa0b3dba16.zip
Trailing whitespace deleted.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c144
1 files changed, 72 insertions, 72 deletions
diff --git a/src/process.c b/src/process.c
index 1998e845421..775415ac1a6 100644
--- a/src/process.c
+++ b/src/process.c
@@ -101,7 +101,7 @@ Boston, MA 02111-1307, USA. */
101#ifdef IRIS 101#ifdef IRIS
102#include <sys/sysmacros.h> /* for "minor" */ 102#include <sys/sysmacros.h> /* for "minor" */
103#endif /* not IRIS */ 103#endif /* not IRIS */
104 104
105#ifdef HAVE_SYS_WAIT 105#ifdef HAVE_SYS_WAIT
106#include <sys/wait.h> 106#include <sys/wait.h>
107#endif 107#endif
@@ -357,7 +357,7 @@ update_status (p)
357 p->raw_status_high = Qnil; 357 p->raw_status_high = Qnil;
358} 358}
359 359
360/* Convert a process status word in Unix format to 360/* Convert a process status word in Unix format to
361 the list that we use internally. */ 361 the list that we use internally. */
362 362
363Lisp_Object 363Lisp_Object
@@ -406,7 +406,7 @@ decode_status (l, symbol, code, coredump)
406 406
407/* Return a string describing a process status list. */ 407/* Return a string describing a process status list. */
408 408
409Lisp_Object 409Lisp_Object
410status_message (status) 410status_message (status)
411 Lisp_Object status; 411 Lisp_Object status;
412{ 412{
@@ -685,7 +685,7 @@ nil, indicating the current buffer's process. */)
685 { 685 {
686 Fkill_process (process, Qnil); 686 Fkill_process (process, Qnil);
687 /* Do this now, since remove_process will make sigchld_handler do nothing. */ 687 /* Do this now, since remove_process will make sigchld_handler do nothing. */
688 XPROCESS (process)->status 688 XPROCESS (process)->status
689 = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil)); 689 = Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
690 XSETINT (XPROCESS (process)->tick, ++process_tick); 690 XSETINT (XPROCESS (process)->tick, ++process_tick);
691 status_notify (); 691 status_notify ();
@@ -847,7 +847,7 @@ t means stop accepting output from the process.
847 847
848When a process has a filter, its buffer is not used for output. 848When a process has a filter, its buffer is not used for output.
849Instead, each time it does output, the entire string of output is 849Instead, each time it does output, the entire string of output is
850passed to the filter. 850passed to the filter.
851 851
852The filter gets two arguments: the process and the string of output. 852The filter gets two arguments: the process and the string of output.
853The string argument is normally a multibyte string, except: 853The string argument is normally a multibyte string, except:
@@ -860,7 +860,7 @@ The string argument is normally a multibyte string, except:
860 register Lisp_Object process, filter; 860 register Lisp_Object process, filter;
861{ 861{
862 struct Lisp_Process *p; 862 struct Lisp_Process *p;
863 863
864 CHECK_PROCESS (process); 864 CHECK_PROCESS (process);
865 p = XPROCESS (process); 865 p = XPROCESS (process);
866 866
@@ -871,7 +871,7 @@ The string argument is normally a multibyte string, except:
871 (setq process (start-process ...)) 871 (setq process (start-process ...))
872 (debug) 872 (debug)
873 (set-process-filter process ...) */ 873 (set-process-filter process ...) */
874 874
875 if (XINT (p->infd) >= 0) 875 if (XINT (p->infd) >= 0)
876 { 876 {
877 if (EQ (filter, Qt) && !EQ (p->status, Qlisten)) 877 if (EQ (filter, Qt) && !EQ (p->status, Qlisten))
@@ -886,7 +886,7 @@ The string argument is normally a multibyte string, except:
886 FD_SET (XINT (p->infd), &non_keyboard_wait_mask); 886 FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
887 } 887 }
888 } 888 }
889 889
890 p->filter = filter; 890 p->filter = filter;
891 if (NETCONN1_P (p)) 891 if (NETCONN1_P (p))
892 p->childp = Fplist_put (p->childp, QCfilter, filter); 892 p->childp = Fplist_put (p->childp, QCfilter, filter);
@@ -937,7 +937,7 @@ DEFUN ("set-process-window-size", Fset_process_window_size,
937 CHECK_PROCESS (process); 937 CHECK_PROCESS (process);
938 CHECK_NATNUM (height); 938 CHECK_NATNUM (height);
939 CHECK_NATNUM (width); 939 CHECK_NATNUM (width);
940 940
941 if (XINT (XPROCESS (process)->infd) < 0 941 if (XINT (XPROCESS (process)->infd) < 0
942 || set_window_size (XINT (XPROCESS (process)->infd), 942 || set_window_size (XINT (XPROCESS (process)->infd),
943 XINT (height), XINT (width)) <= 0) 943 XINT (height), XINT (width)) <= 0)
@@ -1033,7 +1033,7 @@ See `make-network-process' for a list of keywords. */)
1033#ifdef DATAGRAM_SOCKETS 1033#ifdef DATAGRAM_SOCKETS
1034 if (DATAGRAM_CONN_P (process) 1034 if (DATAGRAM_CONN_P (process)
1035 && (EQ (key, Qt) || EQ (key, QCremote))) 1035 && (EQ (key, Qt) || EQ (key, QCremote)))
1036 contact = Fplist_put (contact, QCremote, 1036 contact = Fplist_put (contact, QCremote,
1037 Fprocess_datagram_address (process)); 1037 Fprocess_datagram_address (process));
1038#endif 1038#endif
1039 1039
@@ -1127,7 +1127,7 @@ IP address. Returns nil if format of ADDRESS is invalid. */)
1127 args[0] = build_string ("<Family %d>"); 1127 args[0] = build_string ("<Family %d>");
1128 args[1] = Fcar (address); 1128 args[1] = Fcar (address);
1129 return Fformat (2, args); 1129 return Fformat (2, args);
1130 1130
1131 } 1131 }
1132 1132
1133 return Qnil; 1133 return Qnil;
@@ -1232,7 +1232,7 @@ list_processes_1 (query_only)
1232 if (CONSP (p->status)) 1232 if (CONSP (p->status))
1233 symbol = XCAR (p->status); 1233 symbol = XCAR (p->status);
1234 1234
1235 1235
1236 if (EQ (symbol, Qsignal)) 1236 if (EQ (symbol, Qsignal))
1237 { 1237 {
1238 Lisp_Object tem; 1238 Lisp_Object tem;
@@ -1319,7 +1319,7 @@ list_processes_1 (query_only)
1319 (STRINGP (host) ? (char *)SDATA (host) : "?")); 1319 (STRINGP (host) ? (char *)SDATA (host) : "?"));
1320 insert_string (tembuf); 1320 insert_string (tembuf);
1321 } 1321 }
1322 else 1322 else
1323 { 1323 {
1324 tem = p->command; 1324 tem = p->command;
1325 while (1) 1325 while (1)
@@ -1408,7 +1408,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1408 1408
1409 GCPRO2 (buffer, current_dir); 1409 GCPRO2 (buffer, current_dir);
1410 1410
1411 current_dir 1411 current_dir
1412 = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir), 1412 = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir),
1413 Qnil); 1413 Qnil);
1414 if (NILP (Ffile_accessible_directory_p (current_dir))) 1414 if (NILP (Ffile_accessible_directory_p (current_dir)))
@@ -1512,7 +1512,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1512 strcat (new_argv, SDATA (tem)); 1512 strcat (new_argv, SDATA (tem));
1513 } 1513 }
1514 /* Need to add code here to check for program existence on VMS */ 1514 /* Need to add code here to check for program existence on VMS */
1515 1515
1516#else /* not VMS */ 1516#else /* not VMS */
1517 new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); 1517 new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *));
1518 1518
@@ -1809,7 +1809,7 @@ create_process (process, new_argv, current_dir)
1809 XSETINT (XPROCESS (process)->pid, -1); 1809 XSETINT (XPROCESS (process)->pid, -1);
1810 1810
1811 BLOCK_INPUT; 1811 BLOCK_INPUT;
1812 1812
1813 { 1813 {
1814 /* child_setup must clobber environ on systems with true vfork. 1814 /* child_setup must clobber environ on systems with true vfork.
1815 Protect it from permanent change. */ 1815 Protect it from permanent change. */
@@ -1874,12 +1874,12 @@ create_process (process, new_argv, current_dir)
1874 } 1874 }
1875#endif 1875#endif
1876#endif 1876#endif
1877#ifdef TIOCNOTTY 1877#ifdef TIOCNOTTY
1878 /* In 4.3BSD, the TIOCSPGRP bug has been fixed, and now you 1878 /* In 4.3BSD, the TIOCSPGRP bug has been fixed, and now you
1879 can do TIOCSPGRP only to the process's controlling tty. */ 1879 can do TIOCSPGRP only to the process's controlling tty. */
1880 if (pty_flag) 1880 if (pty_flag)
1881 { 1881 {
1882 /* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here? 1882 /* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here?
1883 I can't test it since I don't have 4.3. */ 1883 I can't test it since I don't have 4.3. */
1884 int j = emacs_open ("/dev/tty", O_RDWR, 0); 1884 int j = emacs_open ("/dev/tty", O_RDWR, 0);
1885 ioctl (j, TIOCNOTTY, 0); 1885 ioctl (j, TIOCNOTTY, 0);
@@ -1974,7 +1974,7 @@ create_process (process, new_argv, current_dir)
1974#ifdef WINDOWSNT 1974#ifdef WINDOWSNT
1975 pid = child_setup (xforkin, xforkout, xforkout, 1975 pid = child_setup (xforkin, xforkout, xforkout,
1976 new_argv, 1, current_dir); 1976 new_argv, 1, current_dir);
1977#else /* not WINDOWSNT */ 1977#else /* not WINDOWSNT */
1978 child_setup (xforkin, xforkout, xforkout, 1978 child_setup (xforkin, xforkout, xforkout,
1979 new_argv, 1, current_dir); 1979 new_argv, 1, current_dir);
1980#endif /* not WINDOWSNT */ 1980#endif /* not WINDOWSNT */
@@ -2007,11 +2007,11 @@ create_process (process, new_argv, current_dir)
2007 { 2007 {
2008 struct atimer *timer; 2008 struct atimer *timer;
2009 EMACS_TIME offset; 2009 EMACS_TIME offset;
2010 2010
2011 stop_polling (); 2011 stop_polling ();
2012 EMACS_SET_SECS_USECS (offset, 1, 0); 2012 EMACS_SET_SECS_USECS (offset, 1, 0);
2013 timer = start_atimer (ATIMER_RELATIVE, offset, create_process_1, 0); 2013 timer = start_atimer (ATIMER_RELATIVE, offset, create_process_1, 0);
2014 2014
2015 XPROCESS (process)->subtty = Qnil; 2015 XPROCESS (process)->subtty = Qnil;
2016 if (forkin >= 0) 2016 if (forkin >= 0)
2017 emacs_close (forkin); 2017 emacs_close (forkin);
@@ -2019,7 +2019,7 @@ create_process (process, new_argv, current_dir)
2019 cancel_atimer (timer); 2019 cancel_atimer (timer);
2020 start_polling (); 2020 start_polling ();
2021 } 2021 }
2022 2022
2023 if (forkin != forkout && forkout >= 0) 2023 if (forkin != forkout && forkout >= 0)
2024 emacs_close (forkout); 2024 emacs_close (forkout);
2025 2025
@@ -2260,7 +2260,7 @@ Returns nil upon error setting address, ADDRESS otherwise. */)
2260 2260
2261static struct socket_options { 2261static struct socket_options {
2262 /* The name of this option. Should be lowercase version of option 2262 /* The name of this option. Should be lowercase version of option
2263 name without SO_ prefix. */ 2263 name without SO_ prefix. */
2264 char *name; 2264 char *name;
2265 /* Length of name. */ 2265 /* Length of name. */
2266 int nlen; 2266 int nlen;
@@ -2406,14 +2406,14 @@ set_socket_options (s, opts, no_error)
2406 arg = (char *) SDATA (val); 2406 arg = (char *) SDATA (val);
2407 else if (XSYMBOL (val)) 2407 else if (XSYMBOL (val))
2408 arg = (char *) SDATA (SYMBOL_NAME (val)); 2408 arg = (char *) SDATA (SYMBOL_NAME (val));
2409 else 2409 else
2410 error ("Invalid argument to %s option", name); 2410 error ("Invalid argument to %s option", name);
2411 } 2411 }
2412 ret = setsockopt (s, sopt->optlevel, sopt->optnum, 2412 ret = setsockopt (s, sopt->optlevel, sopt->optnum,
2413 arg, strlen (arg)); 2413 arg, strlen (arg));
2414 } 2414 }
2415 2415
2416#ifdef SO_LINGER 2416#ifdef SO_LINGER
2417 case SOPT_LINGER: 2417 case SOPT_LINGER:
2418 { 2418 {
2419 struct linger linger; 2419 struct linger linger;
@@ -2455,7 +2455,7 @@ set_socket_options (s, opts, no_error)
2455 2455
2456DEFUN ("set-network-process-options", 2456DEFUN ("set-network-process-options",
2457 Fset_network_process_options, Sset_network_process_options, 2457 Fset_network_process_options, Sset_network_process_options,
2458 1, MANY, 0, 2458 1, MANY, 0,
2459 doc: /* Set one or more options for network process PROCESS. 2459 doc: /* Set one or more options for network process PROCESS.
2460Each option is either a string "OPT=VALUE" or a cons (OPT . VALUE). 2460Each option is either a string "OPT=VALUE" or a cons (OPT . VALUE).
2461A boolean value is false if it either zero or nil, true otherwise. 2461A boolean value is false if it either zero or nil, true otherwise.
@@ -2466,9 +2466,9 @@ pages for more information.
2466bindtodevice=NAME -- bind to interface NAME, or remove binding if nil. 2466bindtodevice=NAME -- bind to interface NAME, or remove binding if nil.
2467broadcast=BOOL -- Allow send and receive of datagram broadcasts. 2467broadcast=BOOL -- Allow send and receive of datagram broadcasts.
2468dontroute=BOOL -- Only send to directly connected hosts. 2468dontroute=BOOL -- Only send to directly connected hosts.
2469keepalive=BOOL -- Send keep-alive messages on network stream. 2469keepalive=BOOL -- Send keep-alive messages on network stream.
2470linger=BOOL or TIMEOUT -- Send queued messages before closing. 2470linger=BOOL or TIMEOUT -- Send queued messages before closing.
2471oobinline=BOOL -- Place out-of-band data in receive data stream. 2471oobinline=BOOL -- Place out-of-band data in receive data stream.
2472priority=INT -- Set protocol defined priority for sent packets. 2472priority=INT -- Set protocol defined priority for sent packets.
2473reuseaddr=BOOL -- Allow reusing a recently used address. 2473reuseaddr=BOOL -- Allow reusing a recently used address.
2474 2474
@@ -2507,8 +2507,8 @@ unwind_request_sigio (dummy)
2507 connection has no PID; you cannot signal it. All you can do is 2507 connection has no PID; you cannot signal it. All you can do is
2508 stop/continue it and deactivate/close it via delete-process */ 2508 stop/continue it and deactivate/close it via delete-process */
2509 2509
2510DEFUN ("make-network-process", Fmake_network_process, Smake_network_process, 2510DEFUN ("make-network-process", Fmake_network_process, Smake_network_process,
2511 0, MANY, 0, 2511 0, MANY, 0,
2512 doc: /* Create and return a network server or client process. 2512 doc: /* Create and return a network server or client process.
2513 2513
2514In Emacs, network connections are represented by process objects, so 2514In Emacs, network connections are represented by process objects, so
@@ -2599,20 +2599,20 @@ is the server process, CLIENT is the new process for the connection,
2599and MESSAGE is a string. 2599and MESSAGE is a string.
2600 2600
2601:plist PLIST -- Install PLIST as the new process' initial plist. 2601:plist PLIST -- Install PLIST as the new process' initial plist.
2602 2602
2603:server BOOL -- if BOOL is non-nil, create a server process for the 2603:server BOOL -- if BOOL is non-nil, create a server process for the
2604specified FAMILY, SERVICE, and connection type (stream or datagram). 2604specified FAMILY, SERVICE, and connection type (stream or datagram).
2605Default is a client process. 2605Default is a client process.
2606 2606
2607A server process will listen for and accept connections from 2607A server process will listen for and accept connections from
2608clients. When a client connection is accepted, a new network process 2608clients. When a client connection is accepted, a new network process
2609is created for the connection with the following parameters: 2609is created for the connection with the following parameters:
2610- The client's process name is constructed by concatenating the server 2610- The client's process name is constructed by concatenating the server
2611process' NAME and a client identification string. 2611process' NAME and a client identification string.
2612- If the FILTER argument is non-nil, the client process will not get a 2612- If the FILTER argument is non-nil, the client process will not get a
2613separate process buffer; otherwise, the client's process buffer is a newly 2613separate process buffer; otherwise, the client's process buffer is a newly
2614created buffer named after the server process' BUFFER name or process 2614created buffer named after the server process' BUFFER name or process
2615NAME concatenated with the client identification string. 2615NAME concatenated with the client identification string.
2616- The connection type and the process filter and sentinel parameters are 2616- The connection type and the process filter and sentinel parameters are
2617inherited from the server process' TYPE, FILTER and SENTINEL. 2617inherited from the server process' TYPE, FILTER and SENTINEL.
2618- The client process' contact info is set according to the client's 2618- The client process' contact info is set according to the client's
@@ -2732,7 +2732,7 @@ usage: (make-network-process &rest ARGS) */)
2732 /* Let's handle TERM before things get complicated ... */ 2732 /* Let's handle TERM before things get complicated ... */
2733 host = Fplist_get (contact, QChost); 2733 host = Fplist_get (contact, QChost);
2734 CHECK_STRING (host); 2734 CHECK_STRING (host);
2735 2735
2736 service = Fplist_get (contact, QCservice); 2736 service = Fplist_get (contact, QCservice);
2737 if (INTEGERP (service)) 2737 if (INTEGERP (service))
2738 port = htons ((unsigned short) XINT (service)); 2738 port = htons ((unsigned short) XINT (service));
@@ -2881,7 +2881,7 @@ usage: (make-network-process &rest ARGS) */)
2881 { 2881 {
2882 struct servent *svc_info; 2882 struct servent *svc_info;
2883 CHECK_STRING (service); 2883 CHECK_STRING (service);
2884 svc_info = getservbyname (SDATA (service), 2884 svc_info = getservbyname (SDATA (service),
2885 (socktype == SOCK_DGRAM ? "udp" : "tcp")); 2885 (socktype == SOCK_DGRAM ? "udp" : "tcp"));
2886 if (svc_info == 0) 2886 if (svc_info == 0)
2887 error ("Unknown service: %s", SDATA (service)); 2887 error ("Unknown service: %s", SDATA (service));
@@ -2904,7 +2904,7 @@ usage: (make-network-process &rest ARGS) */)
2904 QUIT; 2904 QUIT;
2905 host_info_ptr = gethostbyname (SDATA (host)); 2905 host_info_ptr = gethostbyname (SDATA (host));
2906 immediate_quit = 0; 2906 immediate_quit = 0;
2907 2907
2908 if (host_info_ptr) 2908 if (host_info_ptr)
2909 { 2909 {
2910 bcopy (host_info_ptr->h_addr, (char *) &address_in.sin_addr, 2910 bcopy (host_info_ptr->h_addr, (char *) &address_in.sin_addr,
@@ -2985,7 +2985,7 @@ usage: (make-network-process &rest ARGS) */)
2985 } 2985 }
2986 } 2986 }
2987#endif 2987#endif
2988 2988
2989 /* Make us close S if quit. */ 2989 /* Make us close S if quit. */
2990 record_unwind_protect (close_file_unwind, make_number (s)); 2990 record_unwind_protect (close_file_unwind, make_number (s));
2991 2991
@@ -3000,7 +3000,7 @@ usage: (make-network-process &rest ARGS) */)
3000 if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof optval)) 3000 if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof optval))
3001 report_file_error ("Cannot set reuse option on server socket.", Qnil); 3001 report_file_error ("Cannot set reuse option on server socket.", Qnil);
3002 } 3002 }
3003 3003
3004 if (bind (s, lres->ai_addr, lres->ai_addrlen)) 3004 if (bind (s, lres->ai_addr, lres->ai_addrlen))
3005 report_file_error ("Cannot bind server socket", Qnil); 3005 report_file_error ("Cannot bind server socket", Qnil);
3006 3006
@@ -3035,7 +3035,7 @@ usage: (make-network-process &rest ARGS) */)
3035 set. 3035 set.
3036 3036
3037 It'd be nice to be able to control the connect timeout 3037 It'd be nice to be able to control the connect timeout
3038 though. Would non-blocking connect calls be portable? 3038 though. Would non-blocking connect calls be portable?
3039 3039
3040 This used to be conditioned by HAVE_GETADDRINFO. Why? */ 3040 This used to be conditioned by HAVE_GETADDRINFO. Why? */
3041 3041
@@ -3111,7 +3111,7 @@ usage: (make-network-process &rest ARGS) */)
3111 bcopy (lres->ai_addr, datagram_address[s].sa, lres->ai_addrlen); 3111 bcopy (lres->ai_addr, datagram_address[s].sa, lres->ai_addrlen);
3112 } 3112 }
3113#endif 3113#endif
3114 contact = Fplist_put (contact, QCaddress, 3114 contact = Fplist_put (contact, QCaddress,
3115 conv_sockaddr_to_lisp (lres->ai_addr, lres->ai_addrlen)); 3115 conv_sockaddr_to_lisp (lres->ai_addr, lres->ai_addrlen));
3116#ifdef HAVE_GETSOCKNAME 3116#ifdef HAVE_GETSOCKNAME
3117 if (!is_server) 3117 if (!is_server)
@@ -3181,7 +3181,7 @@ usage: (make-network-process &rest ARGS) */)
3181 3181
3182 p->childp = contact; 3182 p->childp = contact;
3183 p->plist = Fcopy_sequence (Fplist_get (contact, QCplist)); 3183 p->plist = Fcopy_sequence (Fplist_get (contact, QCplist));
3184 3184
3185 p->buffer = buffer; 3185 p->buffer = buffer;
3186 p->sentinel = sentinel; 3186 p->sentinel = sentinel;
3187 p->filter = filter; 3187 p->filter = filter;
@@ -3603,12 +3603,12 @@ server_accept_connection (server, channel)
3603 contact = Fplist_put (contact, QChost, host); 3603 contact = Fplist_put (contact, QChost, host);
3604 if (!NILP (service)) 3604 if (!NILP (service))
3605 contact = Fplist_put (contact, QCservice, service); 3605 contact = Fplist_put (contact, QCservice, service);
3606 contact = Fplist_put (contact, QCremote, 3606 contact = Fplist_put (contact, QCremote,
3607 conv_sockaddr_to_lisp (&saddr.sa, len)); 3607 conv_sockaddr_to_lisp (&saddr.sa, len));
3608#ifdef HAVE_GETSOCKNAME 3608#ifdef HAVE_GETSOCKNAME
3609 len = sizeof saddr; 3609 len = sizeof saddr;
3610 if (getsockname (s, &saddr.sa, &len) == 0) 3610 if (getsockname (s, &saddr.sa, &len) == 0)
3611 contact = Fplist_put (contact, QClocal, 3611 contact = Fplist_put (contact, QClocal,
3612 conv_sockaddr_to_lisp (&saddr.sa, len)); 3612 conv_sockaddr_to_lisp (&saddr.sa, len));
3613#endif 3613#endif
3614 3614
@@ -3634,7 +3634,7 @@ server_accept_connection (server, channel)
3634 if (s > max_process_desc) 3634 if (s > max_process_desc)
3635 max_process_desc = s; 3635 max_process_desc = s;
3636 3636
3637 /* Setup coding system for new process based on server process. 3637 /* Setup coding system for new process based on server process.
3638 This seems to be the proper thing to do, as the coding system 3638 This seems to be the proper thing to do, as the coding system
3639 of the new process should reflect the settings at the time the 3639 of the new process should reflect the settings at the time the
3640 server socket was opened; not the current settings. */ 3640 server socket was opened; not the current settings. */
@@ -3668,7 +3668,7 @@ server_accept_connection (server, channel)
3668 build_string ("\n"))); 3668 build_string ("\n")));
3669 3669
3670 if (!NILP (p->sentinel)) 3670 if (!NILP (p->sentinel))
3671 exec_sentinel (proc, 3671 exec_sentinel (proc,
3672 concat3 (build_string ("open from "), 3672 concat3 (build_string ("open from "),
3673 (STRINGP (host) ? host : build_string ("-")), 3673 (STRINGP (host) ? host : build_string ("-")),
3674 build_string ("\n"))); 3674 build_string ("\n")));
@@ -3831,7 +3831,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
3831 { 3831 {
3832 int old_timers_run = timers_run; 3832 int old_timers_run = timers_run;
3833 struct buffer *old_buffer = current_buffer; 3833 struct buffer *old_buffer = current_buffer;
3834 3834
3835 timer_delay = timer_check (1); 3835 timer_delay = timer_check (1);
3836 3836
3837 /* If a timer has run, this might have changed buffers 3837 /* If a timer has run, this might have changed buffers
@@ -3840,7 +3840,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
3840 && old_buffer != current_buffer 3840 && old_buffer != current_buffer
3841 && waiting_for_user_input_p == -1) 3841 && waiting_for_user_input_p == -1)
3842 record_asynch_buffer_change (); 3842 record_asynch_buffer_change ();
3843 3843
3844 if (timers_run != old_timers_run && do_display) 3844 if (timers_run != old_timers_run && do_display)
3845 /* We must retry, since a timer may have requeued itself 3845 /* We must retry, since a timer may have requeued itself
3846 and that could alter the time_delay. */ 3846 and that could alter the time_delay. */
@@ -3902,7 +3902,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
3902 Ctemp = connect_wait_mask; 3902 Ctemp = connect_wait_mask;
3903 EMACS_SET_SECS_USECS (timeout, 0, 0); 3903 EMACS_SET_SECS_USECS (timeout, 0, 0);
3904 if ((select (max (max_process_desc, max_keyboard_desc) + 1, 3904 if ((select (max (max_process_desc, max_keyboard_desc) + 1,
3905 &Atemp, 3905 &Atemp,
3906 (num_pending_connects > 0 ? &Ctemp : (SELECT_TYPE *)0), 3906 (num_pending_connects > 0 ? &Ctemp : (SELECT_TYPE *)0),
3907 (SELECT_TYPE *)0, &timeout) 3907 (SELECT_TYPE *)0, &timeout)
3908 <= 0)) 3908 <= 0))
@@ -3935,7 +3935,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
3935 if (nread == 0) 3935 if (nread == 0)
3936 break; 3936 break;
3937 3937
3938 if (0 < nread) 3938 if (0 < nread)
3939 total_nread += nread; 3939 total_nread += nread;
3940#ifdef EIO 3940#ifdef EIO
3941 else if (nread == -1 && EIO == errno) 3941 else if (nread == -1 && EIO == errno)
@@ -3996,7 +3996,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
3996 if (check_connect) 3996 if (check_connect)
3997 Connecting = connect_wait_mask; 3997 Connecting = connect_wait_mask;
3998 nfds = select (max (max_process_desc, max_keyboard_desc) + 1, 3998 nfds = select (max (max_process_desc, max_keyboard_desc) + 1,
3999 &Available, 3999 &Available,
4000 (check_connect ? &Connecting : (SELECT_TYPE *)0), 4000 (check_connect ? &Connecting : (SELECT_TYPE *)0),
4001 (SELECT_TYPE *)0, &timeout); 4001 (SELECT_TYPE *)0, &timeout);
4002 } 4002 }
@@ -4093,7 +4093,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4093 int old_timers_run = timers_run; 4093 int old_timers_run = timers_run;
4094 struct buffer *old_buffer = current_buffer; 4094 struct buffer *old_buffer = current_buffer;
4095 int leave = 0; 4095 int leave = 0;
4096 4096
4097 if (detect_input_pending_run_timers (do_display)) 4097 if (detect_input_pending_run_timers (do_display))
4098 { 4098 {
4099 swallow_events (do_display); 4099 swallow_events (do_display);
@@ -4110,8 +4110,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4110 4110
4111 if (leave) 4111 if (leave)
4112 break; 4112 break;
4113 } 4113 }
4114 4114
4115 /* If there is unread keyboard input, also return. */ 4115 /* If there is unread keyboard input, also return. */
4116 if (XINT (read_kbd) != 0 4116 if (XINT (read_kbd) != 0
4117 && requeued_events_pending_p ()) 4117 && requeued_events_pending_p ())
@@ -4258,7 +4258,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4258 = Fcons (Qexit, Fcons (make_number (256), Qnil)); 4258 = Fcons (Qexit, Fcons (make_number (256), Qnil));
4259 } 4259 }
4260 } 4260 }
4261#ifdef NON_BLOCKING_CONNECT 4261#ifdef NON_BLOCKING_CONNECT
4262 if (check_connect && FD_ISSET (channel, &Connecting)) 4262 if (check_connect && FD_ISSET (channel, &Connecting))
4263 { 4263 {
4264 struct Lisp_Process *p; 4264 struct Lisp_Process *p;
@@ -4479,7 +4479,7 @@ read_process_output (proc, channel)
4479 outstream = p->filter; 4479 outstream = p->filter;
4480 if (!NILP (outstream)) 4480 if (!NILP (outstream))
4481 { 4481 {
4482 /* We inhibit quit here instead of just catching it so that 4482 /* We inhibit quit here instead of just catching it so that
4483 hitting ^G when a filter happens to be running won't screw 4483 hitting ^G when a filter happens to be running won't screw
4484 it up. */ 4484 it up. */
4485 int count = SPECPDL_INDEX (); 4485 int count = SPECPDL_INDEX ();
@@ -4945,7 +4945,7 @@ send_process (proc, buf, len, object)
4945 || errno == EAGAIN 4945 || errno == EAGAIN
4946#endif 4946#endif
4947 ) 4947 )
4948 /* Buffer is full. Wait, accepting input; 4948 /* Buffer is full. Wait, accepting input;
4949 that may allow the program 4949 that may allow the program
4950 to finish doing output and read more. */ 4950 to finish doing output and read more. */
4951 { 4951 {
@@ -4969,7 +4969,7 @@ send_process (proc, buf, len, object)
4969 the terminal is set up that way which it is 4969 the terminal is set up that way which it is
4970 here). The same bytes will be seen again in a 4970 here). The same bytes will be seen again in a
4971 later read(2), without the CRs. */ 4971 later read(2), without the CRs. */
4972 4972
4973 if (errno == EAGAIN) 4973 if (errno == EAGAIN)
4974 { 4974 {
4975 int flags = FWRITE; 4975 int flags = FWRITE;
@@ -4977,7 +4977,7 @@ send_process (proc, buf, len, object)
4977 &flags); 4977 &flags);
4978 } 4978 }
4979#endif /* BROKEN_PTY_READ_AFTER_EAGAIN */ 4979#endif /* BROKEN_PTY_READ_AFTER_EAGAIN */
4980 4980
4981 /* Running filters might relocate buffers or strings. 4981 /* Running filters might relocate buffers or strings.
4982 Arrange to relocate BUF. */ 4982 Arrange to relocate BUF. */
4983 if (BUFFERP (object)) 4983 if (BUFFERP (object))
@@ -5026,7 +5026,7 @@ send_process (proc, buf, len, object)
5026 XSETINT (XPROCESS (proc)->tick, ++process_tick); 5026 XSETINT (XPROCESS (proc)->tick, ++process_tick);
5027 deactivate_process (proc); 5027 deactivate_process (proc);
5028#ifdef VMS 5028#ifdef VMS
5029 error ("Error writing to process %s; closed it", 5029 error ("Error writing to process %s; closed it",
5030 SDATA (XPROCESS (proc)->name)); 5030 SDATA (XPROCESS (proc)->name));
5031#else 5031#else
5032 error ("SIGPIPE raised on process %s; closed it", 5032 error ("SIGPIPE raised on process %s; closed it",
@@ -5109,7 +5109,7 @@ return t unconditionally. */)
5109 error ("Process %s is not active", 5109 error ("Process %s is not active",
5110 SDATA (p->name)); 5110 SDATA (p->name));
5111 5111
5112#ifdef TIOCGPGRP 5112#ifdef TIOCGPGRP
5113 if (!NILP (p->subtty)) 5113 if (!NILP (p->subtty))
5114 ioctl (XFASTINT (p->subtty), TIOCGPGRP, &gid); 5114 ioctl (XFASTINT (p->subtty), TIOCGPGRP, &gid);
5115 else 5115 else
@@ -5258,7 +5258,7 @@ process_send_signal (process, signo, current_group, nomsg)
5258 /* The code above always returns from the function. */ 5258 /* The code above always returns from the function. */
5259#endif /* defined (SIGNALS_VIA_CHARACTERS) */ 5259#endif /* defined (SIGNALS_VIA_CHARACTERS) */
5260 5260
5261#ifdef TIOCGPGRP 5261#ifdef TIOCGPGRP
5262 /* Get the current pgrp using the tty itself, if we have that. 5262 /* Get the current pgrp using the tty itself, if we have that.
5263 Otherwise, use the pty to get the pgrp. 5263 Otherwise, use the pty to get the pgrp.
5264 On pfa systems, saka@pfu.fujitsu.co.JP writes: 5264 On pfa systems, saka@pfu.fujitsu.co.JP writes:
@@ -5392,7 +5392,7 @@ See function `interrupt-process' for more details on usage. */)
5392 5392
5393DEFUN ("stop-process", Fstop_process, Sstop_process, 0, 2, 0, 5393DEFUN ("stop-process", Fstop_process, Sstop_process, 0, 2, 0,
5394 doc: /* Stop process PROCESS. May be process or name of one. 5394 doc: /* Stop process PROCESS. May be process or name of one.
5395See function `interrupt-process' for more details on usage. 5395See function `interrupt-process' for more details on usage.
5396If PROCESS is a network process, inhibit handling of incoming traffic. */) 5396If PROCESS is a network process, inhibit handling of incoming traffic. */)
5397 (process, current_group) 5397 (process, current_group)
5398 Lisp_Object process, current_group; 5398 Lisp_Object process, current_group;
@@ -5401,7 +5401,7 @@ If PROCESS is a network process, inhibit handling of incoming traffic. */)
5401 if (PROCESSP (process) && NETCONN_P (process)) 5401 if (PROCESSP (process) && NETCONN_P (process))
5402 { 5402 {
5403 struct Lisp_Process *p; 5403 struct Lisp_Process *p;
5404 5404
5405 p = XPROCESS (process); 5405 p = XPROCESS (process);
5406 if (NILP (p->command) 5406 if (NILP (p->command)
5407 && XINT (p->infd) >= 0) 5407 && XINT (p->infd) >= 0)
@@ -5423,7 +5423,7 @@ If PROCESS is a network process, inhibit handling of incoming traffic. */)
5423 5423
5424DEFUN ("continue-process", Fcontinue_process, Scontinue_process, 0, 2, 0, 5424DEFUN ("continue-process", Fcontinue_process, Scontinue_process, 0, 2, 0,
5425 doc: /* Continue process PROCESS. May be process or name of one. 5425 doc: /* Continue process PROCESS. May be process or name of one.
5426See function `interrupt-process' for more details on usage. 5426See function `interrupt-process' for more details on usage.
5427If PROCESS is a network process, resume handling of incoming traffic. */) 5427If PROCESS is a network process, resume handling of incoming traffic. */)
5428 (process, current_group) 5428 (process, current_group)
5429 Lisp_Object process, current_group; 5429 Lisp_Object process, current_group;
@@ -5484,7 +5484,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
5484 } 5484 }
5485 else 5485 else
5486 process = get_process (process); 5486 process = get_process (process);
5487 5487
5488 if (NILP (process)) 5488 if (NILP (process))
5489 return process; 5489 return process;
5490 5490
@@ -5708,7 +5708,7 @@ kill_buffer_processes (buffer)
5708/* On receipt of a signal that a child status has changed, loop asking 5708/* On receipt of a signal that a child status has changed, loop asking
5709 about children with changed statuses until the system says there 5709 about children with changed statuses until the system says there
5710 are no more. 5710 are no more.
5711 5711
5712 All we do is change the status; we do not run sentinels or print 5712 All we do is change the status; we do not run sentinels or print
5713 notifications. That is saved for the next time keyboard input is 5713 notifications. That is saved for the next time keyboard input is
5714 done, in order to avoid timing errors. 5714 done, in order to avoid timing errors.
@@ -5752,7 +5752,7 @@ sigchld_handler (signo)
5752#define WUNTRACED 0 5752#define WUNTRACED 0
5753#endif /* no WUNTRACED */ 5753#endif /* no WUNTRACED */
5754 /* Keep trying to get a status until we get a definitive result. */ 5754 /* Keep trying to get a status until we get a definitive result. */
5755 do 5755 do
5756 { 5756 {
5757 errno = 0; 5757 errno = 0;
5758 pid = wait3 (&w, WNOHANG | WUNTRACED, 0); 5758 pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
@@ -5803,18 +5803,18 @@ sigchld_handler (signo)
5803 break; 5803 break;
5804 p = 0; 5804 p = 0;
5805 } 5805 }
5806 5806
5807 /* Change the status of the process that was found. */ 5807 /* Change the status of the process that was found. */
5808 if (p != 0) 5808 if (p != 0)
5809 { 5809 {
5810 union { int i; WAITTYPE wt; } u; 5810 union { int i; WAITTYPE wt; } u;
5811 int clear_desc_flag = 0; 5811 int clear_desc_flag = 0;
5812 5812
5813 XSETINT (p->tick, ++process_tick); 5813 XSETINT (p->tick, ++process_tick);
5814 u.wt = w; 5814 u.wt = w;
5815 XSETINT (p->raw_status_low, u.i & 0xffff); 5815 XSETINT (p->raw_status_low, u.i & 0xffff);
5816 XSETINT (p->raw_status_high, u.i >> 16); 5816 XSETINT (p->raw_status_high, u.i >> 16);
5817 5817
5818 /* If process has terminated, stop waiting for its output. */ 5818 /* If process has terminated, stop waiting for its output. */
5819 if ((WIFSIGNALED (w) || WIFEXITED (w)) 5819 if ((WIFSIGNALED (w) || WIFEXITED (w))
5820 && XINT (p->infd) >= 0) 5820 && XINT (p->infd) >= 0)
@@ -6342,7 +6342,7 @@ syms_of_process ()
6342 staticpro (&QCoptions); 6342 staticpro (&QCoptions);
6343 QCplist = intern (":plist"); 6343 QCplist = intern (":plist");
6344 staticpro (&QCplist); 6344 staticpro (&QCplist);
6345 6345
6346 Qlast_nonmenu_event = intern ("last-nonmenu-event"); 6346 Qlast_nonmenu_event = intern ("last-nonmenu-event");
6347 staticpro (&Qlast_nonmenu_event); 6347 staticpro (&Qlast_nonmenu_event);
6348 6348
@@ -6472,7 +6472,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
6472 int xerrno; 6472 int xerrno;
6473 /* Either nil or a cons cell, the car of which is of interest and 6473 /* Either nil or a cons cell, the car of which is of interest and
6474 may be changed outside of this routine. */ 6474 may be changed outside of this routine. */
6475 Lisp_Object wait_for_cell; 6475 Lisp_Object wait_for_cell;
6476 6476
6477 wait_for_cell = Qnil; 6477 wait_for_cell = Qnil;
6478 6478