diff src/process.c @ 89958:0bdb5a16ae51

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-27 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-471 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-478 Update from CVS
author Miles Bader <miles@gnu.org>
date Tue, 03 Aug 2004 00:03:00 +0000
parents b9eee0a7bef5 64ae47cb68ff
children d8411455de48
line wrap: on
line diff
--- a/src/process.c	Wed Jul 28 07:05:52 2004 +0000
+++ b/src/process.c	Tue Aug 03 00:03:00 2004 +0000
@@ -4196,7 +4196,7 @@
              present (for reading) at stdin, even when none is.  This
              causes the call to SELECT below to return 1 and
              status_notify not to be called.  As a result output of
-             subprocesses are incorrectly discarded.  
+             subprocesses are incorrectly discarded.
 	  */
           FD_CLR (0, &Atemp);
 #endif
@@ -4763,16 +4763,16 @@
   if (DATAGRAM_CHAN_P (channel))
     {
       int len = datagram_address[channel].len;
-      nbytes = recvfrom (channel, chars + carryover, readmax - carryover,
+      nbytes = recvfrom (channel, chars + carryover, readmax,
 			 0, datagram_address[channel].sa, &len);
     }
   else
 #endif
   if (proc_buffered_char[channel] < 0)
     {
-      nbytes = emacs_read (channel, chars + carryover, readmax - carryover);
+      nbytes = emacs_read (channel, chars + carryover, readmax);
 #ifdef ADAPTIVE_READ_BUFFERING
-      if (!NILP (p->adaptive_read_buffering))
+      if (nbytes > 0 && !NILP (p->adaptive_read_buffering))
 	{
 	  int delay = XINT (p->read_output_delay);
 	  if (nbytes < 256)
@@ -4784,7 +4784,7 @@
 		  delay += READ_OUTPUT_DELAY_INCREMENT * 2;
 		}
 	    }
-	  else if (delay > 0 && (nbytes == readmax - carryover))
+	  else if (delay > 0 && (nbytes == readmax))
 	    {
 	      delay -= READ_OUTPUT_DELAY_INCREMENT;
 	      if (delay == 0)
@@ -4803,7 +4803,7 @@
     {
       chars[carryover] = proc_buffered_char[channel];
       proc_buffered_char[channel] = -1;
-      nbytes = emacs_read (channel, chars + carryover + 1,  readmax - 1 - carryover);
+      nbytes = emacs_read (channel, chars + carryover + 1,  readmax - 1);
       if (nbytes < 0)
 	nbytes = 1;
       else