comparison 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
comparison
equal deleted inserted replaced
89957:c08afac24467 89958:0bdb5a16ae51
4194 #if 0 4194 #if 0
4195 /* On Mac OS X 10.0, the SELECT system call always says input is 4195 /* On Mac OS X 10.0, the SELECT system call always says input is
4196 present (for reading) at stdin, even when none is. This 4196 present (for reading) at stdin, even when none is. This
4197 causes the call to SELECT below to return 1 and 4197 causes the call to SELECT below to return 1 and
4198 status_notify not to be called. As a result output of 4198 status_notify not to be called. As a result output of
4199 subprocesses are incorrectly discarded. 4199 subprocesses are incorrectly discarded.
4200 */ 4200 */
4201 FD_CLR (0, &Atemp); 4201 FD_CLR (0, &Atemp);
4202 #endif 4202 #endif
4203 Ctemp = connect_wait_mask; 4203 Ctemp = connect_wait_mask;
4204 EMACS_SET_SECS_USECS (timeout, 0, 0); 4204 EMACS_SET_SECS_USECS (timeout, 0, 0);
4761 #ifdef DATAGRAM_SOCKETS 4761 #ifdef DATAGRAM_SOCKETS
4762 /* We have a working select, so proc_buffered_char is always -1. */ 4762 /* We have a working select, so proc_buffered_char is always -1. */
4763 if (DATAGRAM_CHAN_P (channel)) 4763 if (DATAGRAM_CHAN_P (channel))
4764 { 4764 {
4765 int len = datagram_address[channel].len; 4765 int len = datagram_address[channel].len;
4766 nbytes = recvfrom (channel, chars + carryover, readmax - carryover, 4766 nbytes = recvfrom (channel, chars + carryover, readmax,
4767 0, datagram_address[channel].sa, &len); 4767 0, datagram_address[channel].sa, &len);
4768 } 4768 }
4769 else 4769 else
4770 #endif 4770 #endif
4771 if (proc_buffered_char[channel] < 0) 4771 if (proc_buffered_char[channel] < 0)
4772 { 4772 {
4773 nbytes = emacs_read (channel, chars + carryover, readmax - carryover); 4773 nbytes = emacs_read (channel, chars + carryover, readmax);
4774 #ifdef ADAPTIVE_READ_BUFFERING 4774 #ifdef ADAPTIVE_READ_BUFFERING
4775 if (!NILP (p->adaptive_read_buffering)) 4775 if (nbytes > 0 && !NILP (p->adaptive_read_buffering))
4776 { 4776 {
4777 int delay = XINT (p->read_output_delay); 4777 int delay = XINT (p->read_output_delay);
4778 if (nbytes < 256) 4778 if (nbytes < 256)
4779 { 4779 {
4780 if (delay < READ_OUTPUT_DELAY_MAX_MAX) 4780 if (delay < READ_OUTPUT_DELAY_MAX_MAX)
4782 if (delay == 0) 4782 if (delay == 0)
4783 process_output_delay_count++; 4783 process_output_delay_count++;
4784 delay += READ_OUTPUT_DELAY_INCREMENT * 2; 4784 delay += READ_OUTPUT_DELAY_INCREMENT * 2;
4785 } 4785 }
4786 } 4786 }
4787 else if (delay > 0 && (nbytes == readmax - carryover)) 4787 else if (delay > 0 && (nbytes == readmax))
4788 { 4788 {
4789 delay -= READ_OUTPUT_DELAY_INCREMENT; 4789 delay -= READ_OUTPUT_DELAY_INCREMENT;
4790 if (delay == 0) 4790 if (delay == 0)
4791 process_output_delay_count--; 4791 process_output_delay_count--;
4792 } 4792 }
4801 } 4801 }
4802 else 4802 else
4803 { 4803 {
4804 chars[carryover] = proc_buffered_char[channel]; 4804 chars[carryover] = proc_buffered_char[channel];
4805 proc_buffered_char[channel] = -1; 4805 proc_buffered_char[channel] = -1;
4806 nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1 - carryover); 4806 nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1);
4807 if (nbytes < 0) 4807 if (nbytes < 0)
4808 nbytes = 1; 4808 nbytes = 1;
4809 else 4809 else
4810 nbytes = nbytes + 1; 4810 nbytes = nbytes + 1;
4811 } 4811 }