Module Name: src
Committed By: martin
Date: Sun Oct 11 10:51:02 UTC 2020
Modified Files:
src/external/bsd/ntp/dist/libntp [netbsd-9]: work_fork.c
Log Message:
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@.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.2.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.13 src/external/bsd/ntp/dist/libntp/work_fork.c:1.13.2.1
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.13 Sat Sep 29 21:52:33 2018
+++ src/external/bsd/ntp/dist/libntp/work_fork.c Sun Oct 11 10:51:02 2020
@@ -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);