summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2007-09-19 07:57:44 +0000
committerGerrit Pape <pape@smarden.org>2007-09-19 07:57:44 +0000
commitf13e09ad39696e7d0459e0e8348933522122b055 (patch)
tree1a56cc28b9c709abda4bda6a701e15a36fcc6c7e /src
parent777dc5387dba0edf9cf194fafb11d4f01c7d32ab (diff)
downloadrunit-f13e09ad39696e7d0459e0e8348933522122b055.tar.gz
runit-f13e09ad39696e7d0459e0e8348933522122b055.tar.xz
runit-f13e09ad39696e7d0459e0e8348933522122b055.zip
* runit.c: force check for zombies after a 14 second timeout without
    signals (CHLD, CONT, INT).
Diffstat (limited to 'src')
-rw-r--r--src/runit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runit.c b/src/runit.c
index 77ee93f..25da3b8 100644
--- a/src/runit.c
+++ b/src/runit.c
@@ -49,6 +49,7 @@ int main (int argc, const char * const *argv, char * const *envp) {
   iopause_fd x;
 #ifndef IOPAUSE_POLL
   fd_set rfds;
+  struct timeval t;
 #endif
   char ch;
   int ttyfd;
@@ -138,10 +139,6 @@ int main (int argc, const char * const *argv, char * const *envp) {
 
     x.fd =selfpipe[0];
     x.events =IOPAUSE_READ;
-#ifndef IOPAUSE_POLL
-    FD_ZERO(&rfds);
-    FD_SET(x.fd, &rfds);
-#endif
     for (;;) {
       int child;
 
@@ -149,9 +146,12 @@ int main (int argc, const char * const *argv, char * const *envp) {
       sig_unblock(sig_cont);
       sig_unblock(sig_int);
 #ifdef IOPAUSE_POLL
-      poll(&x, 1, -1);
+      poll(&x, 1, 14000);
 #else
-      select(x.fd +1, &rfds, (fd_set*)0, (fd_set*)0, (struct timeval*)0);
+      t.tv_sec =14; t.tv_usec =0;
+      FD_ZERO(&rfds);
+      FD_SET(x.fd, &rfds);
+      select(x.fd +1, &rfds, (fd_set*)0, (fd_set*)0, &t);
 #endif
       sig_block(sig_cont);
       sig_block(sig_child);