summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2020-10-11 10:51:02 +0000
committermartin <martin@NetBSD.org>2020-10-11 10:51:02 +0000
commitc19cf677216452bb22e1c4059cb4f9ed4d02bfd9 (patch)
tree8b3b7a915c168c1c4cf0c41f99f82d9635d017b2 /external
parentd6e0f46e784b513e1f5e264bca74c21193f8b539 (diff)
Pull up following revision(s) (requested by kim in ticket #1107):
external/bsd/ntp/dist/libntp/work_fork.c: revision 1.15 Wait for the asynchronous dns resolver child to be done (and close the socket descriptors) before returning. Otherwise we might get bind errors. Reported by kim@, fixed by mlelstv@.
Diffstat (limited to 'external')
-rw-r--r--external/bsd/ntp/dist/libntp/work_fork.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/external/bsd/ntp/dist/libntp/work_fork.c b/external/bsd/ntp/dist/libntp/work_fork.c
index c9a0c4ee349..48158008439 100644
--- a/external/bsd/ntp/dist/libntp/work_fork.c
+++ b/external/bsd/ntp/dist/libntp/work_fork.c
@@ -1,4 +1,4 @@
-/* $NetBSD: work_fork.c,v 1.13 2018/09/29 21:52:33 christos Exp $ */
+/* $NetBSD: work_fork.c,v 1.13.2.1 2020/10/11 10:51:02 martin Exp $ */
/*
* work_fork.c - fork implementation for blocking worker child.
@@ -557,6 +557,9 @@ fork_blocking_child(
/* wire into I/O loop */
(*addremove_io_fd)(c->resp_read_pipe, is_pipe, FALSE);
+ /* wait until child is done */
+ rc = netread(c->resp_read_pipe, &rc, sizeof(rc));
+
return; /* parent returns */
}
@@ -583,6 +586,10 @@ fork_blocking_child(
c->resp_write_pipe = blocking_pipes[3];
kill_asyncio(0);
+
+ /* Tell parent we are ready */
+ rc = netwrite(c->resp_write_pipe, &rc, sizeof(rc));
+
closelog();
if (syslog_file != NULL) {
fclose(syslog_file);