Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/fb1031eb0617
branches:  netbsd-9
changeset: 964152:fb1031eb0617
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Oct 11 10:51:02 2020 +0000

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

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

diffs (30 lines):

diff -r 1e64933e7830 -r fb1031eb0617 external/bsd/ntp/dist/libntp/work_fork.c
--- a/external/bsd/ntp/dist/libntp/work_fork.c  Sat Oct 10 14:36:21 2020 +0000
+++ b/external/bsd/ntp/dist/libntp/work_fork.c  Sun Oct 11 10:51:02 2020 +0000
@@ -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 @@
                /* 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 @@
        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