Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ASC.SLB.COM!steve From: steve@ASC.SLB.COM Newsgroups: gnu.emacs.bug Subject: Process management bug patch - context diff Message-ID: <8912212225.AA01097.steve@boron.ASC.SLB.COM> Date: 21 Dec 89 22:25:32 GMT References: <8912151828.AA07601@sugar-bombs.ai.mit.edu> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 42 Thanks for your comments. The change you propose is incomplete. The current version of read_process_output (I mean the version in dist-18.54) returns 0 whenever the actual read system call returns a non-positive value. That's why I changed it to return the result of the read call: *************** *** 1562,1568 **** nchars = nchars + 1; } ! if (nchars <= 0) return 0; outstream = p->filter; if (!NULL (outstream)) --- 1569,1575 ---- nchars = nchars + 1; } ! if (nchars <= 0) return nchars; /* 0; */ outstream = p->filter; if (!NULL (outstream)) This shouldn't affect other calls to read_process_output, since tests are on its result being positive or non-positive, not 0. The following greps indicate this: boron[steve]42> grep 'read_process_output' /usr/local/emacs/src/*.c /usr/local/emacs/src/process.c: if (n = read_process_output (proc, channel) > 0) /usr/local/emacs/src/process.c:read_process_output (proc, channel) /usr/local/emacs/src/process.c: while (read_process_output (proc, XFASTINT (p->infd)) > 0); boron[steve]48> grep 'read_process_output' /usr/local/emacs/src/*.h boron[steve]49> Without this change to read_process_output, the test for EWOULDBLOCK would never succeed. Thanks as always.