# HG changeset patch # User Richard M. Stallman # Date 866689388 0 # Node ID 0295bbed3c398a76e79118e8a72f02f07a3724eb # Parent 9963d76b10179c66747d63c19757fe85b2c2ce2d (Fprocess_send_eof): Use shutdown, if it's a socket. Don't close the output descriptor if that is also the input descriptor. diff -r 9963d76b1017 -r 0295bbed3c39 src/process.c --- a/src/process.c Thu Jun 19 02:59:08 1997 +0000 +++ b/src/process.c Thu Jun 19 03:03:08 1997 +0000 @@ -3618,7 +3618,16 @@ send_process (proc, "\004", 1, Qnil); else { - close (XINT (XPROCESS (proc)->outfd)); + /* If this is a network connection, or socketpair is used + for communication with the subprocess, call shutdown to cause EOF. + (In some old system, shutdown to socketpair doesn't work. + Then we just can't win.) */ + if (NILP (XPROCESS (proc)->pid) + || XINT (XPROCESS (proc)->outfd) == XINT (XPROCESS (proc)->infd)) + shutdown (XINT (XPROCESS (proc)->outfd), 1); + /* In case of socketpair, outfd == infd, so don't close it. */ + if (XINT (XPROCESS (proc)->outfd) != XINT (XPROCESS (proc)->infd)) + close (XINT (XPROCESS (proc)->outfd)); XSETINT (XPROCESS (proc)->outfd, open (NULL_DEVICE, O_WRONLY)); } #endif /* VMS */