diff options
author | Cy Schubert <cy@FreeBSD.org> | 2024-05-10 15:15:56 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2024-05-26 22:55:52 +0000 |
commit | 1f833b3fc9968c3dd7ed79ccf0525ebf16c891ad (patch) | |
tree | 85801af20e3b694584668aeb39ecec75ee71f72c /ntpd/ntp_loopfilter.c | |
parent | ab1f1aa8333369a83ff284848fc3fc2e52d5f29f (diff) |
Diffstat (limited to 'ntpd/ntp_loopfilter.c')
-rw-r--r-- | ntpd/ntp_loopfilter.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index e76e4dce0711..6378e0d7e669 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -1027,6 +1027,22 @@ rstclock( tc_counter)); if (trans != state && trans != EVNT_FSET) report_event(trans, NULL, NULL); +#ifdef HAVE_WORKING_FORK + if (trans != state && EVNT_SYNC == trans) { + /* + * If our parent process is waiting for the + * first clock sync, send them home satisfied. + */ + if (daemon_pipe[1] != -1) { + if (2 != write(daemon_pipe[1], "S\n", 2)) { + msyslog(LOG_ERR, "daemon failed to notify parent ntpd (--wait-sync)"); + } + close(daemon_pipe[1]); + daemon_pipe[1] = -1; + } + } +#endif /* HAVE_WORKING_FORK */ + state = trans; last_offset = clock_offset = offset; clock_epoch = current_time; |