|
Lines 370-379
process_input(fd_set * readset)
Link Here
|
| 370 |
|
370 |
|
| 371 |
/* Read and buffer any available stdout data from the program. */ |
371 |
/* Read and buffer any available stdout data from the program. */ |
| 372 |
if (!fdout_eof && FD_ISSET(fdout, readset)) { |
372 |
if (!fdout_eof && FD_ISSET(fdout, readset)) { |
|
|
373 |
errno = 0; |
| 373 |
len = read(fdout, buf, sizeof(buf)); |
374 |
len = read(fdout, buf, sizeof(buf)); |
| 374 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) { |
375 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) { |
| 375 |
/* do nothing */ |
376 |
/* do nothing */ |
| 376 |
} else if (len <= 0) { |
377 |
} else if (len < 0 || (len == 0 && errno != 0)) { |
| 377 |
fdout_eof = 1; |
378 |
fdout_eof = 1; |
| 378 |
} else { |
379 |
} else { |
| 379 |
buffer_append(&stdout_buffer, buf, len); |
380 |
buffer_append(&stdout_buffer, buf, len); |
|
Lines 382-391
process_input(fd_set * readset)
Link Here
|
| 382 |
} |
383 |
} |
| 383 |
/* Read and buffer any available stderr data from the program. */ |
384 |
/* Read and buffer any available stderr data from the program. */ |
| 384 |
if (!fderr_eof && FD_ISSET(fderr, readset)) { |
385 |
if (!fderr_eof && FD_ISSET(fderr, readset)) { |
|
|
386 |
errno = 0; |
| 385 |
len = read(fderr, buf, sizeof(buf)); |
387 |
len = read(fderr, buf, sizeof(buf)); |
| 386 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) { |
388 |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) { |
| 387 |
/* do nothing */ |
389 |
/* do nothing */ |
| 388 |
} else if (len <= 0) { |
390 |
} else if (len < 0 || (len == 0 && errno != 0)) { |
| 389 |
fderr_eof = 1; |
391 |
fderr_eof = 1; |
| 390 |
} else { |
392 |
} else { |
| 391 |
buffer_append(&stderr_buffer, buf, len); |
393 |
buffer_append(&stderr_buffer, buf, len); |