+---
+* [Bug 3050] Fix for bug #2960 causes [...] spurious error message.
+ <perlinger@ntp.org>
+ - patches by Reinhard Max <max@suse.com> and Havard Eidnes <he@uninett.no>
+
---
(4.2.8p8) 2016/06/02 Released by Harlan Stenn <stenn@ntp.org>
/*
* harvest_child_status() runs in the parent.
+ *
+ * Note the error handling -- this is an interaction with SIGCHLD.
+ * SIG_IGN on SIGCHLD on some OSes means do not wait but reap
+ * automatically. Since we're not really interested in the result code,
+ * we simply ignore the error.
*/
static void
harvest_child_status(
blocking_child * c
)
{
- if (c->pid)
- {
+ if (c->pid) {
/* Wait on the child so it can finish terminating */
if (waitpid(c->pid, NULL, 0) == c->pid)
TRACE(4, ("harvested child %d\n", c->pid));
- else msyslog(LOG_ERR, "error waiting on child %d: %m", c->pid);
+ else if (errno != ECHILD)
+ msyslog(LOG_ERR, "error waiting on child %d: %m", c->pid);
+ c->pid = 0;
}
}
close(c->resp_read_pipe);
c->resp_read_pipe = -1;
}
- c->pid = 0;
c->resp_read_ctx = NULL;
DEBUG_INSIST(-1 == c->req_read_pipe);
DEBUG_INSIST(-1 == c->resp_write_pipe);
fflush(stdout);
fflush(stderr);
- signal_no_reset(SIGCHLD, SIG_IGN);
+ /* [BUG 3050] setting SIGCHLD to SIG_IGN likely causes unwanted
+ * or undefined effects. We don't do it and leave SIGCHLD alone.
+ */
+ /* signal_no_reset(SIGCHLD, SIG_IGN); */
childpid = fork();
if (-1 == childpid) {