commit e76c3233303373dbc7f8f622663b2a7d9b3e94ed
parent be4855095b2c6eb8674589b150e3281dffa7de51
Author: Gerrit Pape <pape@smarden.org>
Date: Wed, 19 Sep 2007 07:57:44 +0000
* runit.c: force check for zombies after a 14 second timeout without
signals (CHLD, CONT, INT).
Diffstat:
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/package/CHANGES b/package/CHANGES
@@ -15,6 +15,8 @@
on AIX 5.2 ML1, AIX 5.3 ML5 (thx Daniel Clark).
* sv.c: fix race on check for down if pid is 0 and state is run or finish.
* runit.c: speed up collecting zombies.
+ * runit.c: force check for zombies after a 14 second timeout without
+ signals (CHLD, CONT, INT).
1.7.2
Tue, 21 Nov 2006 15:13:47 +0000
diff --git 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);