diff options
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c index 22b85ff5910..24f31220d0d 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -2038,7 +2038,7 @@ create_process (process, new_argv, current_dir) | |||
| 2038 | process_set_signal to fail on SGI when using a pipe. */ | 2038 | process_set_signal to fail on SGI when using a pipe. */ |
| 2039 | setsid (); | 2039 | setsid (); |
| 2040 | /* Make the pty's terminal the controlling terminal. */ | 2040 | /* Make the pty's terminal the controlling terminal. */ |
| 2041 | if (pty_flag) | 2041 | if (pty_flag && xforkin >= 0) |
| 2042 | { | 2042 | { |
| 2043 | #ifdef TIOCSCTTY | 2043 | #ifdef TIOCSCTTY |
| 2044 | /* We ignore the return value | 2044 | /* We ignore the return value |
| @@ -2081,8 +2081,11 @@ create_process (process, new_argv, current_dir) | |||
| 2081 | /* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here? | 2081 | /* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here? |
| 2082 | I can't test it since I don't have 4.3. */ | 2082 | I can't test it since I don't have 4.3. */ |
| 2083 | int j = emacs_open ("/dev/tty", O_RDWR, 0); | 2083 | int j = emacs_open ("/dev/tty", O_RDWR, 0); |
| 2084 | ioctl (j, TIOCNOTTY, 0); | 2084 | if (j >= 0) |
| 2085 | emacs_close (j); | 2085 | { |
| 2086 | ioctl (j, TIOCNOTTY, 0); | ||
| 2087 | emacs_close (j); | ||
| 2088 | } | ||
| 2086 | #ifndef USG | 2089 | #ifndef USG |
| 2087 | /* In order to get a controlling terminal on some versions | 2090 | /* In order to get a controlling terminal on some versions |
| 2088 | of BSD, it is necessary to put the process in pgrp 0 | 2091 | of BSD, it is necessary to put the process in pgrp 0 |