Mercurial > emacs
comparison src/process.c @ 51046:2c49296df7d3
(read_process_output): Back out change from 2003-03-09.
| author | David Kastrup <dak@gnu.org> |
|---|---|
| date | Sat, 17 May 2003 20:03:22 +0000 |
| parents | df60111d0379 |
| children | 41ed31a0fd49 |
comparison
equal
deleted
inserted
replaced
| 51045:2d746ed41a7c | 51046:2c49296df7d3 |
|---|---|
| 4461 #ifdef DATAGRAM_SOCKETS | 4461 #ifdef DATAGRAM_SOCKETS |
| 4462 /* We have a working select, so proc_buffered_char is always -1. */ | 4462 /* We have a working select, so proc_buffered_char is always -1. */ |
| 4463 if (DATAGRAM_CHAN_P (channel)) | 4463 if (DATAGRAM_CHAN_P (channel)) |
| 4464 { | 4464 { |
| 4465 int len = datagram_address[channel].len; | 4465 int len = datagram_address[channel].len; |
| 4466 nbytes = recvfrom (channel, chars + carryover, readmax, | 4466 nbytes = recvfrom (channel, chars + carryover, readmax - carryover, |
| 4467 0, datagram_address[channel].sa, &len); | 4467 0, datagram_address[channel].sa, &len); |
| 4468 } | 4468 } |
| 4469 else | 4469 else |
| 4470 #endif | 4470 #endif |
| 4471 if (proc_buffered_char[channel] < 0) | 4471 if (proc_buffered_char[channel] < 0) |
| 4472 nbytes = emacs_read (channel, chars + carryover, readmax); | 4472 nbytes = emacs_read (channel, chars + carryover, readmax - carryover); |
| 4473 else | 4473 else |
| 4474 { | 4474 { |
| 4475 chars[carryover] = proc_buffered_char[channel]; | 4475 chars[carryover] = proc_buffered_char[channel]; |
| 4476 proc_buffered_char[channel] = -1; | 4476 proc_buffered_char[channel] = -1; |
| 4477 nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1); | 4477 nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1 - carryover); |
| 4478 if (nbytes < 0) | 4478 if (nbytes < 0) |
| 4479 nbytes = 1; | 4479 nbytes = 1; |
| 4480 else | 4480 else |
| 4481 nbytes = nbytes + 1; | 4481 nbytes = nbytes + 1; |
| 4482 } | 4482 } |
