Mercurial > emacs
changeset 22939:572895549f80
(Fprocess_send_eof): Transfer proc_encode_coding_system
data to the new outfd.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 08 Aug 1998 00:49:24 +0000 |
parents | a45f2afb8ed9 |
children | 3cfe86230c87 |
files | src/process.c |
diffstat | 1 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/process.c Fri Aug 07 23:43:51 1998 +0000 +++ b/src/process.c Sat Aug 08 00:49:24 1998 +0000 @@ -3850,6 +3850,8 @@ send_process (proc, "\004", 1, Qnil); else { + int old_outfd, new_outfd; + #ifdef HAVE_SHUTDOWN /* If this is a network connection, or socketpair is used for communication with the subprocess, call shutdown to cause EOF. @@ -3864,7 +3866,19 @@ #else /* not HAVE_SHUTDOWN */ close (XINT (XPROCESS (proc)->outfd)); #endif /* not HAVE_SHUTDOWN */ - XSETINT (XPROCESS (proc)->outfd, open (NULL_DEVICE, O_WRONLY)); + new_outfd = open (NULL_DEVICE, O_WRONLY); + old_outfd = XINT (XPROCESS (proc)->outfd); + + if (!proc_encode_coding_system[new_outfd]) + proc_encode_coding_system[new_outfd] + = (struct coding_system *) xmalloc (sizeof (struct coding_system)); + bcopy (proc_encode_coding_system[old_outfd], + proc_encode_coding_system[new_outfd], + sizeof (struct coding_system)); + bzero (proc_encode_coding_system[old_outfd], + sizeof (struct coding_system)); + + XSETINT (XPROCESS (proc)->outfd, new_outfd); } #endif /* VMS */ return process;