diff --git a/external/bsd/ntp/dist/libntp/work_fork.c b/external/bsd/ntp/dist/libntp/work_fork.c index c9a0c4ee349a..9ac25ce62d45 100644 --- a/external/bsd/ntp/dist/libntp/work_fork.c +++ b/external/bsd/ntp/dist/libntp/work_fork.c @@ -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);