Commit 9b73fa0b authored by Sam Steingold's avatar Sam Steingold
Browse files

tweak last patch: add comment and avoid the first sleep

parent dc9332a6
......@@ -6495,13 +6495,16 @@ sigchld_handler (signo)
#define WUNTRACED 0
#endif /* no WUNTRACED */
/* Keep trying to get a status until we get a definitive result. */
do
{
sleep (1);
errno = 0;
pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
}
while (pid < 0 && errno == EINTR);
while (1) {
errno = 0;
pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
if (! (pid < 0 && errno == EINTR))
break;
/* avoid a busyloop: wait3 is a system call, so we do not want
to prevent the kernel from actually sending SIGCHLD to emacs
by asking for it all the time */
sleep (1);
}
if (pid <= 0)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment