<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 2 Sep 2005, at 13:40, sean finney wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">so what, redhat is now defaulting to having that set?<SPAN class="Apple-converted-space">  </SPAN>i think i see a</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">way around this, but i'm not sure:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">- set a signal handler for SIGCHLD</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">- when SIGCHLD is thrown, we do exactly the opposite from the above, and</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>*not* call any wait functions.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">i think that should leave the child as a zombie, for our later call to</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">waitpid.</DIV></BLOCKQUOTE><BR></DIV><DIV>Tried this patch to popen.c:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--- popen.c.original    2005-09-02 14:02:33.760495184 +0100</DIV><DIV>+++ popen.c     2005-09-02 14:30:08.322963456 +0100</DIV><DIV>@@ -67,6 +67,8 @@</DIV><DIV>/*extern pid_t *childpid = NULL; *//* ptr to array allocated at run-time */</DIV><DIV>static int maxfd;                                                              /* from our open_max(), {Prog openmax} */</DIV><DIV>+void sigchld_handler(int signo) { printf( "Caught sigchld\n"); return; }   /* Do nothing */</DIV><DIV>+</DIV><DIV>FILE *</DIV><DIV>spopen (const char *cmdstring)</DIV><DIV>{</DIV><DIV>@@ -171,6 +173,7 @@</DIV><DIV>        if (pipe (pfderr) < 0)</DIV><DIV>                return (NULL);                                                  /* errno set by pipe() */</DIV><DIV>+       signal(SIGCHLD, &sigchld_handler);</DIV><DIV>        if ((pid = fork ()) < 0)</DIV><DIV>                return (NULL);                                                  /* errno set by fork() */</DIV><DIV>        else if (pid == 0) {                                    /* child */</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>While this works consistently on debian and MacOSX (with output of:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Caught sigchld</DIV><DIV>DNS OK: 0.099 seconds response time altinity.com returns 216.68.81.208|time=0.098571s;;;0.000000</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>wrapped in a 'while true; do ./check_dns -H altinity.com || break ; done' loop), I still get the occasional error on Red Hat. Amazingly, there is no Caught sigchld for the failing scenario, which I find hard to understand. Any other suggestions from anyone?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Ton</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><FONT class="Apple-style-span" color="#0000DD"></FONT></BODY></HTML>