aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/process.c b/src/process.c
index 4611ce2c05c..f3162c9d3e5 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6401,12 +6401,16 @@ sigchld_handler (signo)
6401#define WUNTRACED 0 6401#define WUNTRACED 0
6402#endif /* no WUNTRACED */ 6402#endif /* no WUNTRACED */
6403 /* Keep trying to get a status until we get a definitive result. */ 6403 /* Keep trying to get a status until we get a definitive result. */
6404 do 6404 while (1) {
6405 { 6405 errno = 0;
6406 errno = 0; 6406 pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
6407 pid = wait3 (&w, WNOHANG | WUNTRACED, 0); 6407 if (! (pid < 0 && errno == EINTR))
6408 } 6408 break;
6409 while (pid < 0 && errno == EINTR); 6409 /* avoid a busyloop: wait3 is a system call, so we do not want
6410 to prevent the kernel from actually sending SIGCHLD to emacs
6411 by asking for it all the time */
6412 sleep (1);
6413 }
6410 6414
6411 if (pid <= 0) 6415 if (pid <= 0)
6412 { 6416 {