- check 'write' for daemon wait pipe
bk: 5f952c953LyvLA_9gJSWnltSvgzWvQ
*/
#ifdef HAVE_WORKING_FORK
if (daemon_pipe[1] != -1) {
- write(daemon_pipe[1], "S\n", 2);
+ if (2 != write(daemon_pipe[1], "S\n", 2))
+ msyslog(LOG_ERR, "ntpd: daemon failed to notify parent!");
close(daemon_pipe[1]);
daemon_pipe[1] = -1;
DPRINTF(1, ("notified parent --wait-sync is done\n"));
#if defined(SYS_WINNT)
ntservice_isup();
#elif defined(HAVE_WORKING_FORK)
- if (daemon_pipe[1] != -1) {
- write(daemon_pipe[1], "R\n", 2);
+ if ((daemon_pipe[1] != -1) && (2 != write(daemon_pipe[1], "R\n", 2))) {
+ msyslog(LOG_ERR, "ntpd: daemon failed to notify parent!");
+ close(daemon_pipe[1]);
+ daemon_pipe[1] = -1;
}
#endif /* HAVE_WORKING_FORK */