diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/process.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/process.c b/src/process.c index 0fbbd5d34c3..975d92f36f1 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -6495,13 +6495,16 @@ sigchld_handler (signo) | |||
| 6495 | #define WUNTRACED 0 | 6495 | #define WUNTRACED 0 |
| 6496 | #endif /* no WUNTRACED */ | 6496 | #endif /* no WUNTRACED */ |
| 6497 | /* Keep trying to get a status until we get a definitive result. */ | 6497 | /* Keep trying to get a status until we get a definitive result. */ |
| 6498 | do | 6498 | while (1) { |
| 6499 | { | 6499 | errno = 0; |
| 6500 | sleep (1); | 6500 | pid = wait3 (&w, WNOHANG | WUNTRACED, 0); |
| 6501 | errno = 0; | 6501 | if (! (pid < 0 && errno == EINTR)) |
| 6502 | pid = wait3 (&w, WNOHANG | WUNTRACED, 0); | 6502 | break; |
| 6503 | } | 6503 | /* avoid a busyloop: wait3 is a system call, so we do not want |
| 6504 | while (pid < 0 && errno == EINTR); | 6504 | to prevent the kernel from actually sending SIGCHLD to emacs |
| 6505 | by asking for it all the time */ | ||
| 6506 | sleep (1); | ||
| 6507 | } | ||
| 6505 | 6508 | ||
| 6506 | if (pid <= 0) | 6509 | if (pid <= 0) |
| 6507 | { | 6510 | { |