diff options
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c index 4ad8fe24af5..bed3e381d5e 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3618,7 +3618,16 @@ text to PROCESS after you call this function.") | |||
| 3618 | send_process (proc, "\004", 1, Qnil); | 3618 | send_process (proc, "\004", 1, Qnil); |
| 3619 | else | 3619 | else |
| 3620 | { | 3620 | { |
| 3621 | close (XINT (XPROCESS (proc)->outfd)); | 3621 | /* If this is a network connection, or socketpair is used |
| 3622 | for communication with the subprocess, call shutdown to cause EOF. | ||
| 3623 | (In some old system, shutdown to socketpair doesn't work. | ||
| 3624 | Then we just can't win.) */ | ||
| 3625 | if (NILP (XPROCESS (proc)->pid) | ||
| 3626 | || XINT (XPROCESS (proc)->outfd) == XINT (XPROCESS (proc)->infd)) | ||
| 3627 | shutdown (XINT (XPROCESS (proc)->outfd), 1); | ||
| 3628 | /* In case of socketpair, outfd == infd, so don't close it. */ | ||
| 3629 | if (XINT (XPROCESS (proc)->outfd) != XINT (XPROCESS (proc)->infd)) | ||
| 3630 | close (XINT (XPROCESS (proc)->outfd)); | ||
| 3622 | XSETINT (XPROCESS (proc)->outfd, open (NULL_DEVICE, O_WRONLY)); | 3631 | XSETINT (XPROCESS (proc)->outfd, open (NULL_DEVICE, O_WRONLY)); |
| 3623 | } | 3632 | } |
| 3624 | #endif /* VMS */ | 3633 | #endif /* VMS */ |