diff options
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/process.c b/src/process.c index 572ab83de09..307e82819d6 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -204,7 +204,7 @@ static EMACS_INT update_tick; | |||
| 204 | #ifndef NON_BLOCKING_CONNECT | 204 | #ifndef NON_BLOCKING_CONNECT |
| 205 | #ifdef HAVE_SELECT | 205 | #ifdef HAVE_SELECT |
| 206 | #if defined (HAVE_GETPEERNAME) || defined (GNU_LINUX) | 206 | #if defined (HAVE_GETPEERNAME) || defined (GNU_LINUX) |
| 207 | #if O_NONBLOCK || O_NDELAY | 207 | #if defined (O_NONBLOCK) || defined (O_NDELAY) |
| 208 | #if defined (EWOULDBLOCK) || defined (EINPROGRESS) | 208 | #if defined (EWOULDBLOCK) || defined (EINPROGRESS) |
| 209 | #define NON_BLOCKING_CONNECT | 209 | #define NON_BLOCKING_CONNECT |
| 210 | #endif /* EWOULDBLOCK || EINPROGRESS */ | 210 | #endif /* EWOULDBLOCK || EINPROGRESS */ |
| @@ -651,7 +651,7 @@ allocate_pty (void) | |||
| 651 | PTY_OPEN; | 651 | PTY_OPEN; |
| 652 | #else /* no PTY_OPEN */ | 652 | #else /* no PTY_OPEN */ |
| 653 | { | 653 | { |
| 654 | # if O_NONBLOCK | 654 | # ifdef O_NONBLOCK |
| 655 | fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0); | 655 | fd = emacs_open (pty_name, O_RDWR | O_NONBLOCK, 0); |
| 656 | # else | 656 | # else |
| 657 | fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0); | 657 | fd = emacs_open (pty_name, O_RDWR | O_NDELAY, 0); |
| @@ -668,7 +668,7 @@ allocate_pty (void) | |||
| 668 | #else | 668 | #else |
| 669 | sprintf (pty_name, "/dev/tty%c%x", c, i); | 669 | sprintf (pty_name, "/dev/tty%c%x", c, i); |
| 670 | #endif /* no PTY_TTY_NAME_SPRINTF */ | 670 | #endif /* no PTY_TTY_NAME_SPRINTF */ |
| 671 | if (faccessat (AT_FDCWD, pty_name, R_OK | W_OK, AT_EACCESS) != 0) | 671 | if (access (pty_name, 6) != 0) |
| 672 | { | 672 | { |
| 673 | emacs_close (fd); | 673 | emacs_close (fd); |
| 674 | # ifndef __sgi | 674 | # ifndef __sgi |
| @@ -1621,7 +1621,7 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1621 | #if ! defined (USG) || defined (USG_SUBTTY_WORKS) | 1621 | #if ! defined (USG) || defined (USG_SUBTTY_WORKS) |
| 1622 | /* On most USG systems it does not work to open the pty's tty here, | 1622 | /* On most USG systems it does not work to open the pty's tty here, |
| 1623 | then close it and reopen it in the child. */ | 1623 | then close it and reopen it in the child. */ |
| 1624 | #if O_NOCTTY | 1624 | #ifdef O_NOCTTY |
| 1625 | /* Don't let this terminal become our controlling terminal | 1625 | /* Don't let this terminal become our controlling terminal |
| 1626 | (in case we don't have one). */ | 1626 | (in case we don't have one). */ |
| 1627 | forkout = forkin = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0); | 1627 | forkout = forkin = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0); |
| @@ -1675,11 +1675,11 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) | |||
| 1675 | } | 1675 | } |
| 1676 | #endif | 1676 | #endif |
| 1677 | 1677 | ||
| 1678 | #if O_NONBLOCK | 1678 | #ifdef O_NONBLOCK |
| 1679 | fcntl (inchannel, F_SETFL, O_NONBLOCK); | 1679 | fcntl (inchannel, F_SETFL, O_NONBLOCK); |
| 1680 | fcntl (outchannel, F_SETFL, O_NONBLOCK); | 1680 | fcntl (outchannel, F_SETFL, O_NONBLOCK); |
| 1681 | #else | 1681 | #else |
| 1682 | #if O_NDELAY | 1682 | #ifdef O_NDELAY |
| 1683 | fcntl (inchannel, F_SETFL, O_NDELAY); | 1683 | fcntl (inchannel, F_SETFL, O_NDELAY); |
| 1684 | fcntl (outchannel, F_SETFL, O_NDELAY); | 1684 | fcntl (outchannel, F_SETFL, O_NDELAY); |
| 1685 | #endif | 1685 | #endif |
| @@ -1967,7 +1967,7 @@ create_pty (Lisp_Object process) | |||
| 1967 | #if ! defined (USG) || defined (USG_SUBTTY_WORKS) | 1967 | #if ! defined (USG) || defined (USG_SUBTTY_WORKS) |
| 1968 | /* On most USG systems it does not work to open the pty's tty here, | 1968 | /* On most USG systems it does not work to open the pty's tty here, |
| 1969 | then close it and reopen it in the child. */ | 1969 | then close it and reopen it in the child. */ |
| 1970 | #if O_NOCTTY | 1970 | #ifdef O_NOCTTY |
| 1971 | /* Don't let this terminal become our controlling terminal | 1971 | /* Don't let this terminal become our controlling terminal |
| 1972 | (in case we don't have one). */ | 1972 | (in case we don't have one). */ |
| 1973 | int forkout = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0); | 1973 | int forkout = emacs_open (pty_name, O_RDWR | O_NOCTTY, 0); |
| @@ -1987,11 +1987,11 @@ create_pty (Lisp_Object process) | |||
| 1987 | } | 1987 | } |
| 1988 | #endif /* HAVE_PTYS */ | 1988 | #endif /* HAVE_PTYS */ |
| 1989 | 1989 | ||
| 1990 | #if O_NONBLOCK | 1990 | #ifdef O_NONBLOCK |
| 1991 | fcntl (inchannel, F_SETFL, O_NONBLOCK); | 1991 | fcntl (inchannel, F_SETFL, O_NONBLOCK); |
| 1992 | fcntl (outchannel, F_SETFL, O_NONBLOCK); | 1992 | fcntl (outchannel, F_SETFL, O_NONBLOCK); |
| 1993 | #else | 1993 | #else |
| 1994 | #if O_NDELAY | 1994 | #ifdef O_NDELAY |
| 1995 | fcntl (inchannel, F_SETFL, O_NDELAY); | 1995 | fcntl (inchannel, F_SETFL, O_NDELAY); |
| 1996 | fcntl (outchannel, F_SETFL, O_NDELAY); | 1996 | fcntl (outchannel, F_SETFL, O_NDELAY); |
| 1997 | #endif | 1997 | #endif |
| @@ -2951,7 +2951,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2951 | { | 2951 | { |
| 2952 | /* Don't support network sockets when non-blocking mode is | 2952 | /* Don't support network sockets when non-blocking mode is |
| 2953 | not available, since a blocked Emacs is not useful. */ | 2953 | not available, since a blocked Emacs is not useful. */ |
| 2954 | #if !O_NONBLOCK && !O_NDELAY | 2954 | #if !defined (O_NONBLOCK) && !defined (O_NDELAY) |
| 2955 | error ("Network servers not supported"); | 2955 | error ("Network servers not supported"); |
| 2956 | #else | 2956 | #else |
| 2957 | is_server = 1; | 2957 | is_server = 1; |
| @@ -3217,7 +3217,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3217 | #ifdef NON_BLOCKING_CONNECT | 3217 | #ifdef NON_BLOCKING_CONNECT |
| 3218 | if (is_non_blocking_client) | 3218 | if (is_non_blocking_client) |
| 3219 | { | 3219 | { |
| 3220 | #if O_NONBLOCK | 3220 | #ifdef O_NONBLOCK |
| 3221 | ret = fcntl (s, F_SETFL, O_NONBLOCK); | 3221 | ret = fcntl (s, F_SETFL, O_NONBLOCK); |
| 3222 | #else | 3222 | #else |
| 3223 | ret = fcntl (s, F_SETFL, O_NDELAY); | 3223 | ret = fcntl (s, F_SETFL, O_NDELAY); |
| @@ -3434,10 +3434,10 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3434 | 3434 | ||
| 3435 | chan_process[inch] = proc; | 3435 | chan_process[inch] = proc; |
| 3436 | 3436 | ||
| 3437 | #if O_NONBLOCK | 3437 | #ifdef O_NONBLOCK |
| 3438 | fcntl (inch, F_SETFL, O_NONBLOCK); | 3438 | fcntl (inch, F_SETFL, O_NONBLOCK); |
| 3439 | #else | 3439 | #else |
| 3440 | #if O_NDELAY | 3440 | #ifdef O_NDELAY |
| 3441 | fcntl (inch, F_SETFL, O_NDELAY); | 3441 | fcntl (inch, F_SETFL, O_NDELAY); |
| 3442 | #endif | 3442 | #endif |
| 3443 | #endif | 3443 | #endif |
| @@ -4169,10 +4169,10 @@ server_accept_connection (Lisp_Object server, int channel) | |||
| 4169 | 4169 | ||
| 4170 | chan_process[s] = proc; | 4170 | chan_process[s] = proc; |
| 4171 | 4171 | ||
| 4172 | #if O_NONBLOCK | 4172 | #ifdef O_NONBLOCK |
| 4173 | fcntl (s, F_SETFL, O_NONBLOCK); | 4173 | fcntl (s, F_SETFL, O_NONBLOCK); |
| 4174 | #else | 4174 | #else |
| 4175 | #if O_NDELAY | 4175 | #ifdef O_NDELAY |
| 4176 | fcntl (s, F_SETFL, O_NDELAY); | 4176 | fcntl (s, F_SETFL, O_NDELAY); |
| 4177 | #endif | 4177 | #endif |
| 4178 | #endif | 4178 | #endif |
| @@ -4873,11 +4873,11 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 4873 | #endif | 4873 | #endif |
| 4874 | /* ISC 4.1 defines both EWOULDBLOCK and O_NONBLOCK, | 4874 | /* ISC 4.1 defines both EWOULDBLOCK and O_NONBLOCK, |
| 4875 | and Emacs uses O_NONBLOCK, so what we get is EAGAIN. */ | 4875 | and Emacs uses O_NONBLOCK, so what we get is EAGAIN. */ |
| 4876 | #if O_NONBLOCK | 4876 | #ifdef O_NONBLOCK |
| 4877 | else if (nread == -1 && errno == EAGAIN) | 4877 | else if (nread == -1 && errno == EAGAIN) |
| 4878 | ; | 4878 | ; |
| 4879 | #else | 4879 | #else |
| 4880 | #if O_NDELAY | 4880 | #ifdef O_NDELAY |
| 4881 | else if (nread == -1 && errno == EAGAIN) | 4881 | else if (nread == -1 && errno == EAGAIN) |
| 4882 | ; | 4882 | ; |
| 4883 | /* Note that we cannot distinguish between no input | 4883 | /* Note that we cannot distinguish between no input |
| @@ -7363,7 +7363,7 @@ init_process_emacs (void) | |||
| 7363 | #ifdef HAVE_GETSOCKNAME | 7363 | #ifdef HAVE_GETSOCKNAME |
| 7364 | ADD_SUBFEATURE (QCservice, Qt); | 7364 | ADD_SUBFEATURE (QCservice, Qt); |
| 7365 | #endif | 7365 | #endif |
| 7366 | #if O_NONBLOCK || O_NDELAY | 7366 | #if defined (O_NONBLOCK) || defined (O_NDELAY) |
| 7367 | ADD_SUBFEATURE (QCserver, Qt); | 7367 | ADD_SUBFEATURE (QCserver, Qt); |
| 7368 | #endif | 7368 | #endif |
| 7369 | 7369 | ||