diff options
| author | Pip Cet | 2020-09-14 15:18:52 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-09-14 15:18:52 +0200 |
| commit | 312da4871925b9a575c5e3bffd4bf4db4c1108da (patch) | |
| tree | 7fea08391d2481302d29276803bdede6c9688649 /src/process.c | |
| parent | f450e53d5c01c589986bea07671acebaaf501c5f (diff) | |
| download | emacs-312da4871925b9a575c5e3bffd4bf4db4c1108da.tar.gz emacs-312da4871925b9a575c5e3bffd4bf4db4c1108da.zip | |
Don't retry reading after receiving EINVAL
* src/process.c (wait_reading_process_output): Don't retry reading
from an fd after an unknown error (bug#6074).
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c index 3aa105ae342..53f4a1d8530 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5413,14 +5413,16 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, | |||
| 5413 | /* If data can be read from the process, do so until exhausted. */ | 5413 | /* If data can be read from the process, do so until exhausted. */ |
| 5414 | if (wait_proc->infd >= 0) | 5414 | if (wait_proc->infd >= 0) |
| 5415 | { | 5415 | { |
| 5416 | unsigned int count = 0; | ||
| 5416 | XSETPROCESS (proc, wait_proc); | 5417 | XSETPROCESS (proc, wait_proc); |
| 5417 | 5418 | ||
| 5418 | while (true) | 5419 | while (true) |
| 5419 | { | 5420 | { |
| 5420 | int nread = read_process_output (proc, wait_proc->infd); | 5421 | int nread = read_process_output (proc, wait_proc->infd); |
| 5422 | rarely_quit (++count); | ||
| 5421 | if (nread < 0) | 5423 | if (nread < 0) |
| 5422 | { | 5424 | { |
| 5423 | if (errno == EIO || would_block (errno)) | 5425 | if (errno != EINTR) |
| 5424 | break; | 5426 | break; |
| 5425 | } | 5427 | } |
| 5426 | else | 5428 | else |