Module Name: src
Committed By: christos
Date: Fri Jul 17 15:17:07 UTC 2015
Modified Files:
src/external/bsd/ntp/dist/libntp: work_fork.c
Log Message:
PR/50048: Martin Husemann: Avoid reaping the child twice by setting c->pid = 0
after the wait.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/libntp/work_fork.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/ntp/dist/libntp/work_fork.c
diff -u src/external/bsd/ntp/dist/libntp/work_fork.c:1.5 src/external/bsd/ntp/dist/libntp/work_fork.c:1.6
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.5 Fri Jul 10 10:20:32 2015
+++ src/external/bsd/ntp/dist/libntp/work_fork.c Fri Jul 17 11:17:07 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: work_fork.c,v 1.5 2015/07/10 14:20:32 christos Exp $ */
+/* $NetBSD: work_fork.c,v 1.6 2015/07/17 15:17:07 christos Exp $ */
/*
* work_fork.c - fork implementation for blocking worker child.
@@ -128,6 +128,7 @@ harvest_child_status(
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);
+ c->pid = 0;
}
}
@@ -164,7 +165,6 @@ cleanup_after_child(
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);