comparison src/process.c @ 90786:ca12f314faac

Changes from arch/CVS synchronization
author Miles Bader <miles@gnu.org>
date Sun, 18 Mar 2007 14:00:43 +0000
parents 8c2ef9d5d4a8
children 91bf6e05918b
comparison
equal deleted inserted replaced
90785:8c2ef9d5d4a8 90786:ca12f314faac
6399 #ifdef WNOHANG 6399 #ifdef WNOHANG
6400 #ifndef WUNTRACED 6400 #ifndef WUNTRACED
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 while (1) { 6404 do
6405 errno = 0; 6405 {
6406 pid = wait3 (&w, WNOHANG | WUNTRACED, 0); 6406 errno = 0;
6407 if (! (pid < 0 && errno == EINTR)) 6407 pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
6408 break; 6408 }
6409 /* avoid a busyloop: wait3 is a system call, so we do not want 6409 while (pid < 0 && errno == EINTR);
6410 to prevent the kernel from actually sending SIGCHLD to emacs
6411 by asking for it all the time */
6412 sleep (1);
6413 }
6414 6410
6415 if (pid <= 0) 6411 if (pid <= 0)
6416 { 6412 {
6417 /* PID == 0 means no processes found, PID == -1 means a real 6413 /* PID == 0 means no processes found, PID == -1 means a real
6418 failure. We have done all our job, so return. */ 6414 failure. We have done all our job, so return. */