From: Dave Hart Date: Fri, 2 Jun 2023 23:42:10 +0000 (+0000) Subject: [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at event_sync. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caf04588bfbc19c926038186bb7a652d493c6366;p=thirdparty%2Fntp.git [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at event_sync. bk: 647a7e521P8r02gG1kihRFrWb9tOeQ --- diff --git a/ChangeLog b/ChangeLog index 8e34d2a96..e906d9677 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +--- +* [Bug 3824] Spurious "ntpd: daemon failed to notify parent!" logged at + event_sync. Reported by Edward McGuire. + --- (4.2.8p16) 2023/05/31 Released by Harlan Stenn diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index ea72dd3d3..f2c592384 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -2987,8 +2987,9 @@ clock_update( */ #ifdef HAVE_WORKING_FORK if (daemon_pipe[1] != -1) { - if (2 != write(daemon_pipe[1], "S\n", 2)) - msyslog(LOG_ERR, "ntpd: daemon failed to notify parent!"); + 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; DPRINTF(1, ("notified parent --wait-sync is done\n")); diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index f05924de7..868f7a9c8 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -1450,8 +1450,10 @@ int scmp_sc[] = { #if defined(SYS_WINNT) ntservice_isup(); #elif defined(HAVE_WORKING_FORK) - if ((daemon_pipe[1] != -1) && (2 != write(daemon_pipe[1], "R\n", 2))) { - msyslog(LOG_ERR, "ntpd: daemon failed to notify parent!"); + if (daemon_pipe[1] != -1) { + if (2 != write(daemon_pipe[1], "R\n", 2)) { + msyslog(LOG_ERR, "daemon failed to notify parent ntpd after init"); + } close(daemon_pipe[1]); daemon_pipe[1] = -1; }