Module Name: src
Committed By: martin
Date: Sun Oct 11 10:53:45 UTC 2020
Modified Files:
src/external/bsd/ntp/dist/libntp [netbsd-8]: work_fork.c
Log Message:
Pull up following revision(s) (requested by kim in ticket #1615):
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@.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.4.1 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.11 src/external/bsd/ntp/dist/libntp/work_fork.c:1.11.4.1
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.11 Thu Apr 13 20:17:42 2017
+++ src/external/bsd/ntp/dist/libntp/work_fork.c Sun Oct 11 10:53:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: work_fork.c,v 1.11 2017/04/13 20:17:42 christos Exp $ */
+/* $NetBSD: work_fork.c,v 1.11.4.1 2020/10/11 10:53:45 martin Exp $ */
/*
* work_fork.c - fork implementation for blocking worker child.
@@ -529,6 +529,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 */
}
@@ -565,6 +568,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);