Index: execunix.c =================================================================== --- execunix.c (revision 78797) +++ execunix.c (working copy) @@ -66,7 +66,7 @@ */ static clock_t tps = 0; -static struct timespec tv; +static struct timeval tv; static int select_timeout = 0; static int intr = 0; static int cmdsrunning = 0; @@ -504,6 +504,7 @@ int status; int finished; fd_set fds; + sigset_t saved_sigmask; /* Handle naive make1() which does not know if commands are running. */ if ( !cmdsrunning ) @@ -516,29 +517,33 @@ /* Compute max read file descriptor for use in select(). */ populate_file_descriptors( &fd_max, &fds ); + sigprocmask(SIG_SETMASK, &empty_sigmask, &saved_sigmask); + if ( 0 < globs.timeout ) { /* Force select() to timeout so we can terminate expired processes. */ tv.tv_sec = select_timeout; - tv.tv_nsec = 0; + tv.tv_usec = 0; /* select() will wait until: i/o on a descriptor, a signal, or we * time out. */ - ret = pselect( fd_max + 1, &fds, 0, 0, &tv, &empty_sigmask ); + ret = select( fd_max + 1, &fds, 0, 0, &tv ); } else { - /* pselect() will wait until i/o on a descriptor or a signal. */ - ret = pselect( fd_max + 1, &fds, 0, 0, 0, &empty_sigmask ); + /* select() will wait until i/o on a descriptor or a signal. */ + ret = select( fd_max + 1, &fds, 0, 0, 0 ); } if (-1 == ret && errno != EINTR) { - perror("pselect()"); + perror("select()"); exit(-1); } + sigprocmask(SIG_SETMASK, &saved_sigmask, NULL); + if (0 < child_events) { /* child terminated via SIGCHLD */ for (i=0; i