From: Richard M. Stallman Date: Sat, 8 Aug 1998 00:49:24 +0000 (+0000) Subject: (Fprocess_send_eof): Transfer proc_encode_coding_system X-Git-Tag: emacs-20.3~140 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4525f571f59325bf72846c8ab38263f8b78a2e64;p=emacs.git (Fprocess_send_eof): Transfer proc_encode_coding_system data to the new outfd. --- diff --git a/src/process.c b/src/process.c index 2cfd00917ae..2ca75250706 100644 --- a/src/process.c +++ b/src/process.c @@ -3850,6 +3850,8 @@ text to PROCESS after you call this function.") 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 @@ text to PROCESS after you call this function.") #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;