aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorSam Steingold2007-03-11 21:08:45 +0000
committerSam Steingold2007-03-11 21:08:45 +0000
commit9b73fa0b88684652935aae9edfadd2fd309b0ace (patch)
tree4a1fa3eed4db20267e6bc66d72fb6ed4b303c4b1 /src/process.c
parentdc9332a69ee49c2ef634cec55ee69c9367e8e905 (diff)
downloademacs-9b73fa0b88684652935aae9edfadd2fd309b0ace.tar.gz
emacs-9b73fa0b88684652935aae9edfadd2fd309b0ace.zip
tweak last patch: add comment and avoid the first sleep
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c17
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 {