comparison src/process.c @ 83185:09f3fd9f680d

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-473 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-474 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-475 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-476 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-477 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-478 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-225
author Karoly Lorentey <lorentey@elte.hu>
date Tue, 03 Aug 2004 12:45:59 +0000
parents e657dca8261e 64ae47cb68ff
children b15f799f66b5
comparison
equal deleted inserted replaced
83184:7aa4bb74fe30 83185:09f3fd9f680d
4193 #if 0 4193 #if 0
4194 /* On Mac OS X 10.0, the SELECT system call always says input is 4194 /* On Mac OS X 10.0, the SELECT system call always says input is
4195 present (for reading) at stdin, even when none is. This 4195 present (for reading) at stdin, even when none is. This
4196 causes the call to SELECT below to return 1 and 4196 causes the call to SELECT below to return 1 and
4197 status_notify not to be called. As a result output of 4197 status_notify not to be called. As a result output of
4198 subprocesses are incorrectly discarded. 4198 subprocesses are incorrectly discarded.
4199 */ 4199 */
4200 FD_CLR (0, &Atemp); 4200 FD_CLR (0, &Atemp);
4201 #endif 4201 #endif
4202 Ctemp = connect_wait_mask; 4202 Ctemp = connect_wait_mask;
4203 EMACS_SET_SECS_USECS (timeout, 0, 0); 4203 EMACS_SET_SECS_USECS (timeout, 0, 0);
4760 #ifdef DATAGRAM_SOCKETS 4760 #ifdef DATAGRAM_SOCKETS
4761 /* We have a working select, so proc_buffered_char is always -1. */ 4761 /* We have a working select, so proc_buffered_char is always -1. */
4762 if (DATAGRAM_CHAN_P (channel)) 4762 if (DATAGRAM_CHAN_P (channel))
4763 { 4763 {
4764 int len = datagram_address[channel].len; 4764 int len = datagram_address[channel].len;
4765 nbytes = recvfrom (channel, chars + carryover, readmax - carryover, 4765 nbytes = recvfrom (channel, chars + carryover, readmax,
4766 0, datagram_address[channel].sa, &len); 4766 0, datagram_address[channel].sa, &len);
4767 } 4767 }
4768 else 4768 else
4769 #endif 4769 #endif
4770 if (proc_buffered_char[channel] < 0) 4770 if (proc_buffered_char[channel] < 0)
4771 { 4771 {
4772 nbytes = emacs_read (channel, chars + carryover, readmax - carryover); 4772 nbytes = emacs_read (channel, chars + carryover, readmax);
4773 #ifdef ADAPTIVE_READ_BUFFERING 4773 #ifdef ADAPTIVE_READ_BUFFERING
4774 if (!NILP (p->adaptive_read_buffering)) 4774 if (nbytes > 0 && !NILP (p->adaptive_read_buffering))
4775 { 4775 {
4776 int delay = XINT (p->read_output_delay); 4776 int delay = XINT (p->read_output_delay);
4777 if (nbytes < 256) 4777 if (nbytes < 256)
4778 { 4778 {
4779 if (delay < READ_OUTPUT_DELAY_MAX_MAX) 4779 if (delay < READ_OUTPUT_DELAY_MAX_MAX)
4781 if (delay == 0) 4781 if (delay == 0)
4782 process_output_delay_count++; 4782 process_output_delay_count++;
4783 delay += READ_OUTPUT_DELAY_INCREMENT * 2; 4783 delay += READ_OUTPUT_DELAY_INCREMENT * 2;
4784 } 4784 }
4785 } 4785 }
4786 else if (delay > 0 && (nbytes == readmax - carryover)) 4786 else if (delay > 0 && (nbytes == readmax))
4787 { 4787 {
4788 delay -= READ_OUTPUT_DELAY_INCREMENT; 4788 delay -= READ_OUTPUT_DELAY_INCREMENT;
4789 if (delay == 0) 4789 if (delay == 0)
4790 process_output_delay_count--; 4790 process_output_delay_count--;
4791 } 4791 }
4800 } 4800 }
4801 else 4801 else
4802 { 4802 {
4803 chars[carryover] = proc_buffered_char[channel]; 4803 chars[carryover] = proc_buffered_char[channel];
4804 proc_buffered_char[channel] = -1; 4804 proc_buffered_char[channel] = -1;
4805 nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1 - carryover); 4805 nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1);
4806 if (nbytes < 0) 4806 if (nbytes < 0)
4807 nbytes = 1; 4807 nbytes = 1;
4808 else 4808 else
4809 nbytes = nbytes + 1; 4809 nbytes = nbytes + 1;
4810 } 4810 }