# HG changeset patch # User Richard M. Stallman # Date 902537364 0 # Node ID 572895549f80459ea5021081e0b9bcd2d14c990b # Parent a45f2afb8ed988f4c0ece6366e6c6a490655d390 (Fprocess_send_eof): Transfer proc_encode_coding_system data to the new outfd. diff -r a45f2afb8ed9 -r 572895549f80 src/process.c --- 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;