Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/external/bsd/ntp/dist/libntp Pull up following revision(s...



details:   https://anonhg.NetBSD.org/src/rev/edb2f1272f50
branches:  netbsd-8
changeset: 940599:edb2f1272f50
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Oct 11 10:53:45 2020 +0000

description:
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@.

diffstat:

 external/bsd/ntp/dist/libntp/work_fork.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r ff8fe3a81830 -r edb2f1272f50 external/bsd/ntp/dist/libntp/work_fork.c
--- a/external/bsd/ntp/dist/libntp/work_fork.c  Sat Oct 10 14:38:03 2020 +0000
+++ b/external/bsd/ntp/dist/libntp/work_fork.c  Sun Oct 11 10:53:45 2020 +0000
@@ -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 @@
                /* 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 @@
        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);



Home | Main Index | Thread Index | Old Index