From: Gerd Moellmann Date: Thu, 7 Oct 1999 11:37:40 +0000 (+0000) Subject: (wait_reading_process_input): When trying to suck X-Git-Tag: emacs-pretest-21.0.90~6549 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e1b37c346847589fbcb83a4bf1bab5f07401c8c4;p=emacs.git (wait_reading_process_input): When trying to suck input from one process, for accept-process-output, exit that loop if we get EAGAIN or EWOULDBLOCK. --- diff --git a/src/process.c b/src/process.c index cc658400dbb..2cb1dd908ce 100644 --- a/src/process.c +++ b/src/process.c @@ -2541,15 +2541,26 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) XSETPROCESS (proc, wait_proc); /* Read data from the process, until we exhaust it. */ - while (XINT (wait_proc->infd) >= 0 - && (nread - = read_process_output (proc, XINT (wait_proc->infd)))) + while (XINT (wait_proc->infd) >= 0) { + nread = read_process_output (proc, XINT (wait_proc->infd)); + + if (nread == 0) + break; + if (0 < nread) total_nread += nread; #ifdef EIO else if (nread == -1 && EIO == errno) break; +#endif +#ifdef EAGAIN + else if (nread == -1 && EAGAIN == errno) + break; +#endif +#ifdef EWOULDBLOCK + else if (nread == -1 && EWOULDBLOCK == errno) + break; #endif } if (total_nread > 0 && do_display)