diff options
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 52 |
1 files changed, 20 insertions, 32 deletions
diff --git a/src/process.c b/src/process.c index b157ca469b7..e5546488aae 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -78,7 +78,7 @@ Boston, MA 02110-1301, USA. */ | |||
| 78 | #include <client.h> | 78 | #include <client.h> |
| 79 | #endif | 79 | #endif |
| 80 | 80 | ||
| 81 | /* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */ | 81 | /* On some systems, inet_addr returns a 'struct in_addr'. */ |
| 82 | #ifdef HAVE_BROKEN_INET_ADDR | 82 | #ifdef HAVE_BROKEN_INET_ADDR |
| 83 | #define IN_ADDR struct in_addr | 83 | #define IN_ADDR struct in_addr |
| 84 | #define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1) | 84 | #define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1) |
| @@ -87,12 +87,12 @@ Boston, MA 02110-1301, USA. */ | |||
| 87 | #define NUMERIC_ADDR_ERROR (numeric_addr == -1) | 87 | #define NUMERIC_ADDR_ERROR (numeric_addr == -1) |
| 88 | #endif | 88 | #endif |
| 89 | 89 | ||
| 90 | #if defined(BSD_SYSTEM) || defined(STRIDE) | 90 | #if defined(BSD_SYSTEM) |
| 91 | #include <sys/ioctl.h> | 91 | #include <sys/ioctl.h> |
| 92 | #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) | 92 | #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) |
| 93 | #include <fcntl.h> | 93 | #include <fcntl.h> |
| 94 | #endif /* HAVE_PTYS and no O_NDELAY */ | 94 | #endif /* HAVE_PTYS and no O_NDELAY */ |
| 95 | #endif /* BSD_SYSTEM || STRIDE */ | 95 | #endif /* BSD_SYSTEM */ |
| 96 | 96 | ||
| 97 | #ifdef BROKEN_O_NONBLOCK | 97 | #ifdef BROKEN_O_NONBLOCK |
| 98 | #undef O_NONBLOCK | 98 | #undef O_NONBLOCK |
| @@ -596,7 +596,6 @@ allocate_pty () | |||
| 596 | #else | 596 | #else |
| 597 | sprintf (pty_name, "/dev/tty%c%x", c, i); | 597 | sprintf (pty_name, "/dev/tty%c%x", c, i); |
| 598 | #endif /* no PTY_TTY_NAME_SPRINTF */ | 598 | #endif /* no PTY_TTY_NAME_SPRINTF */ |
| 599 | #ifndef UNIPLUS | ||
| 600 | if (access (pty_name, 6) != 0) | 599 | if (access (pty_name, 6) != 0) |
| 601 | { | 600 | { |
| 602 | emacs_close (fd); | 601 | emacs_close (fd); |
| @@ -606,7 +605,6 @@ allocate_pty () | |||
| 606 | return -1; | 605 | return -1; |
| 607 | # endif /* IRIS */ | 606 | # endif /* IRIS */ |
| 608 | } | 607 | } |
| 609 | #endif /* not UNIPLUS */ | ||
| 610 | setup_pty (fd); | 608 | setup_pty (fd); |
| 611 | return fd; | 609 | return fd; |
| 612 | } | 610 | } |
| @@ -1360,8 +1358,11 @@ list_processes_1 (query_only) | |||
| 1360 | w_proc = i; | 1358 | w_proc = i; |
| 1361 | if (!NILP (p->buffer)) | 1359 | if (!NILP (p->buffer)) |
| 1362 | { | 1360 | { |
| 1363 | if (NILP (XBUFFER (p->buffer)->name) && w_buffer < 8) | 1361 | if (NILP (XBUFFER (p->buffer)->name)) |
| 1364 | w_buffer = 8; /* (Killed) */ | 1362 | { |
| 1363 | if (w_buffer < 8) | ||
| 1364 | w_buffer = 8; /* (Killed) */ | ||
| 1365 | } | ||
| 1365 | else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer))) | 1366 | else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer))) |
| 1366 | w_buffer = i; | 1367 | w_buffer = i; |
| 1367 | } | 1368 | } |
| @@ -1888,12 +1889,12 @@ create_process (process, new_argv, current_dir) | |||
| 1888 | #endif | 1889 | #endif |
| 1889 | if (forkin < 0) | 1890 | if (forkin < 0) |
| 1890 | report_file_error ("Opening pty", Qnil); | 1891 | report_file_error ("Opening pty", Qnil); |
| 1891 | #if defined (RTU) || defined (UNIPLUS) || defined (DONT_REOPEN_PTY) | 1892 | #if defined (DONT_REOPEN_PTY) |
| 1892 | /* In the case that vfork is defined as fork, the parent process | 1893 | /* In the case that vfork is defined as fork, the parent process |
| 1893 | (Emacs) may send some data before the child process completes | 1894 | (Emacs) may send some data before the child process completes |
| 1894 | tty options setup. So we setup tty before forking. */ | 1895 | tty options setup. So we setup tty before forking. */ |
| 1895 | child_setup_tty (forkout); | 1896 | child_setup_tty (forkout); |
| 1896 | #endif /* RTU or UNIPLUS or DONT_REOPEN_PTY */ | 1897 | #endif /* DONT_REOPEN_PTY */ |
| 1897 | #else | 1898 | #else |
| 1898 | forkin = forkout = -1; | 1899 | forkin = forkout = -1; |
| 1899 | #endif /* not USG, or USG_SUBTTY_WORKS */ | 1900 | #endif /* not USG, or USG_SUBTTY_WORKS */ |
| @@ -1934,15 +1935,6 @@ create_process (process, new_argv, current_dir) | |||
| 1934 | set_exclusive_use (outchannel); | 1935 | set_exclusive_use (outchannel); |
| 1935 | #endif | 1936 | #endif |
| 1936 | 1937 | ||
| 1937 | /* Stride people say it's a mystery why this is needed | ||
| 1938 | as well as the O_NDELAY, but that it fails without this. */ | ||
| 1939 | #if defined (STRIDE) || (defined (pfa) && defined (HAVE_PTYS)) | ||
| 1940 | { | ||
| 1941 | int one = 1; | ||
| 1942 | ioctl (inchannel, FIONBIO, &one); | ||
| 1943 | } | ||
| 1944 | #endif | ||
| 1945 | |||
| 1946 | #ifdef O_NONBLOCK | 1938 | #ifdef O_NONBLOCK |
| 1947 | fcntl (inchannel, F_SETFL, O_NONBLOCK); | 1939 | fcntl (inchannel, F_SETFL, O_NONBLOCK); |
| 1948 | fcntl (outchannel, F_SETFL, O_NONBLOCK); | 1940 | fcntl (outchannel, F_SETFL, O_NONBLOCK); |
| @@ -1992,7 +1984,7 @@ create_process (process, new_argv, current_dir) | |||
| 1992 | #ifdef BSD4_1 | 1984 | #ifdef BSD4_1 |
| 1993 | sighold (SIGCHLD); | 1985 | sighold (SIGCHLD); |
| 1994 | #else /* not BSD4_1 */ | 1986 | #else /* not BSD4_1 */ |
| 1995 | #if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) | 1987 | #if defined (BSD_SYSTEM) || defined (HPUX) |
| 1996 | sigsetmask (sigmask (SIGCHLD)); | 1988 | sigsetmask (sigmask (SIGCHLD)); |
| 1997 | #else /* ordinary USG */ | 1989 | #else /* ordinary USG */ |
| 1998 | #if 0 | 1990 | #if 0 |
| @@ -2106,7 +2098,7 @@ create_process (process, new_argv, current_dir) | |||
| 2106 | } | 2098 | } |
| 2107 | #endif /* TIOCNOTTY */ | 2099 | #endif /* TIOCNOTTY */ |
| 2108 | 2100 | ||
| 2109 | #if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY) | 2101 | #if !defined (DONT_REOPEN_PTY) |
| 2110 | /*** There is a suggestion that this ought to be a | 2102 | /*** There is a suggestion that this ought to be a |
| 2111 | conditional on TIOCSPGRP, | 2103 | conditional on TIOCSPGRP, |
| 2112 | or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)). | 2104 | or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)). |
| @@ -2140,7 +2132,7 @@ create_process (process, new_argv, current_dir) | |||
| 2140 | ioctl (xforkout, TIOCSPGRP, &pgrp); | 2132 | ioctl (xforkout, TIOCSPGRP, &pgrp); |
| 2141 | #endif | 2133 | #endif |
| 2142 | } | 2134 | } |
| 2143 | #endif /* not UNIPLUS and not RTU and not DONT_REOPEN_PTY */ | 2135 | #endif /* not DONT_REOPEN_PTY */ |
| 2144 | 2136 | ||
| 2145 | #ifdef SETUP_SLAVE_PTY | 2137 | #ifdef SETUP_SLAVE_PTY |
| 2146 | if (pty_flag) | 2138 | if (pty_flag) |
| @@ -2167,7 +2159,7 @@ create_process (process, new_argv, current_dir) | |||
| 2167 | #ifdef BSD4_1 | 2159 | #ifdef BSD4_1 |
| 2168 | sigrelse (SIGCHLD); | 2160 | sigrelse (SIGCHLD); |
| 2169 | #else /* not BSD4_1 */ | 2161 | #else /* not BSD4_1 */ |
| 2170 | #if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) | 2162 | #if defined (BSD_SYSTEM) || defined (HPUX) |
| 2171 | sigsetmask (SIGEMPTYMASK); | 2163 | sigsetmask (SIGEMPTYMASK); |
| 2172 | #else /* ordinary USG */ | 2164 | #else /* ordinary USG */ |
| 2173 | #if 0 | 2165 | #if 0 |
| @@ -2178,10 +2170,10 @@ create_process (process, new_argv, current_dir) | |||
| 2178 | #endif /* SIGCHLD */ | 2170 | #endif /* SIGCHLD */ |
| 2179 | #endif /* !POSIX_SIGNALS */ | 2171 | #endif /* !POSIX_SIGNALS */ |
| 2180 | 2172 | ||
| 2181 | #if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY) | 2173 | #if !defined (DONT_REOPEN_PTY) |
| 2182 | if (pty_flag) | 2174 | if (pty_flag) |
| 2183 | child_setup_tty (xforkout); | 2175 | child_setup_tty (xforkout); |
| 2184 | #endif /* not RTU and not UNIPLUS and not DONT_REOPEN_PTY */ | 2176 | #endif /* not DONT_REOPEN_PTY */ |
| 2185 | #ifdef WINDOWSNT | 2177 | #ifdef WINDOWSNT |
| 2186 | pid = child_setup (xforkin, xforkout, xforkout, | 2178 | pid = child_setup (xforkin, xforkout, xforkout, |
| 2187 | new_argv, 1, current_dir); | 2179 | new_argv, 1, current_dir); |
| @@ -2259,7 +2251,7 @@ create_process (process, new_argv, current_dir) | |||
| 2259 | #ifdef BSD4_1 | 2251 | #ifdef BSD4_1 |
| 2260 | sigrelse (SIGCHLD); | 2252 | sigrelse (SIGCHLD); |
| 2261 | #else /* not BSD4_1 */ | 2253 | #else /* not BSD4_1 */ |
| 2262 | #if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) | 2254 | #if defined (BSD_SYSTEM) || defined (HPUX) |
| 2263 | sigsetmask (SIGEMPTYMASK); | 2255 | sigsetmask (SIGEMPTYMASK); |
| 2264 | #else /* ordinary USG */ | 2256 | #else /* ordinary USG */ |
| 2265 | #if 0 | 2257 | #if 0 |
| @@ -4650,12 +4642,6 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4650 | else if (xerrno == ENOMEM) | 4642 | else if (xerrno == ENOMEM) |
| 4651 | no_avail = 1; | 4643 | no_avail = 1; |
| 4652 | #endif | 4644 | #endif |
| 4653 | #ifdef ALLIANT | ||
| 4654 | /* This happens for no known reason on ALLIANT. | ||
| 4655 | I am guessing that this is the right response. -- RMS. */ | ||
| 4656 | else if (xerrno == EFAULT) | ||
| 4657 | no_avail = 1; | ||
| 4658 | #endif | ||
| 4659 | else if (xerrno == EBADF) | 4645 | else if (xerrno == EBADF) |
| 4660 | { | 4646 | { |
| 4661 | #ifdef AIX | 4647 | #ifdef AIX |
| @@ -4717,6 +4703,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4717 | { | 4703 | { |
| 4718 | int old_timers_run = timers_run; | 4704 | int old_timers_run = timers_run; |
| 4719 | struct buffer *old_buffer = current_buffer; | 4705 | struct buffer *old_buffer = current_buffer; |
| 4706 | Lisp_Object old_window = selected_window; | ||
| 4720 | int leave = 0; | 4707 | int leave = 0; |
| 4721 | 4708 | ||
| 4722 | if (detect_input_pending_run_timers (do_display)) | 4709 | if (detect_input_pending_run_timers (do_display)) |
| @@ -4730,7 +4717,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4730 | an alike. Make read_key_sequence aware of that. */ | 4717 | an alike. Make read_key_sequence aware of that. */ |
| 4731 | if (timers_run != old_timers_run | 4718 | if (timers_run != old_timers_run |
| 4732 | && waiting_for_user_input_p == -1 | 4719 | && waiting_for_user_input_p == -1 |
| 4733 | && old_buffer != current_buffer) | 4720 | && (old_buffer != current_buffer |
| 4721 | || !EQ (old_window, selected_window))) | ||
| 4734 | record_asynch_buffer_change (); | 4722 | record_asynch_buffer_change (); |
| 4735 | 4723 | ||
| 4736 | if (leave) | 4724 | if (leave) |