diff options
| author | Kim F. Storm | 2004-08-01 23:10:06 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-08-01 23:10:06 +0000 |
| commit | 39b1da208b66d626706391d06715c39bdce7adaa (patch) | |
| tree | 3104f570430c5cdc643bfc31b94a2520645047fc /src/process.c | |
| parent | f491e1edab82eb6f7030889385f6d08fe85123fd (diff) | |
| download | emacs-39b1da208b66d626706391d06715c39bdce7adaa.tar.gz emacs-39b1da208b66d626706391d06715c39bdce7adaa.zip | |
(read_process_output): Use whole read buffer.
Don't trigger adaptive read buffering on errors.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/process.c b/src/process.c index aad36b904b5..5e83214f4f9 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4195,7 +4195,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 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 |
| @@ -4762,16 +4762,16 @@ read_process_output (proc, channel) | |||
| 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) |
| @@ -4783,7 +4783,7 @@ read_process_output (proc, channel) | |||
| 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) |
| @@ -4802,7 +4802,7 @@ read_process_output (proc, channel) | |||
| 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 |