changeset 25894:8bd3e6fbf42f

(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.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 07 Oct 1999 11:37:40 +0000
parents 08f4200f6cbf
children 1f372b20fb99
files src/process.c
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Thu Oct 07 11:32:09 1999 +0000
+++ b/src/process.c	Thu Oct 07 11:37:40 1999 +0000
@@ -2541,16 +2541,27 @@
 	  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)
 	    redisplay_preserve_echo_area ();