summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphessler <phessler@openbsd.org>2017-01-20 01:21:18 +0000
committerphessler <phessler@openbsd.org>2017-01-20 01:21:18 +0000
commit9079b9e17fb04e4592cd6298c6675b8d8bf7ab2a (patch)
tree7d80ffce467cdabc4885a5c0897bc05cb04cf3e6
parent#ifndef SMALL around a couple of non-SMALL labels. (diff)
downloadwireguard-openbsd-9079b9e17fb04e4592cd6298c6675b8d8bf7ab2a.tar.xz
wireguard-openbsd-9079b9e17fb04e4592cd6298c6675b8d8bf7ab2a.zip
add logging messages to distinguish which safty check failed
-rw-r--r--usr.sbin/ntpd/ntp.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index d3cb8ca461d..2fbaaf7149f 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.144 2016/09/26 16:55:02 rzalamena Exp $ */
+/* $OpenBSD: ntp.c,v 1.145 2017/01/20 01:21:18 phessler Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -358,8 +358,10 @@ ntp_main(struct ntpd_conf *nconf, struct passwd *pw, int argc, char **argv)
if (nfds > 0 && pfd[PFD_PIPE_MAIN].revents & (POLLIN|POLLERR)) {
nfds--;
- if (ntp_dispatch_imsg() == -1)
+ if (ntp_dispatch_imsg() == -1) {
+ log_warn("pipe write error (from main)");
ntp_quit = 1;
+ }
}
if (nfds > 0 && (pfd[PFD_PIPE_DNS].revents & POLLOUT))
@@ -371,8 +373,10 @@ ntp_main(struct ntpd_conf *nconf, struct passwd *pw, int argc, char **argv)
if (nfds > 0 && pfd[PFD_PIPE_DNS].revents & (POLLIN|POLLERR)) {
nfds--;
- if (ntp_dispatch_imsg_dns() == -1)
+ if (ntp_dispatch_imsg_dns() == -1) {
+ log_warn("pipe write error (from dns engine)");
ntp_quit = 1;
+ }
}
if (nfds > 0 && pfd[PFD_SOCK_CTL].revents & (POLLIN|POLLERR)) {
@@ -383,16 +387,20 @@ ntp_main(struct ntpd_conf *nconf, struct passwd *pw, int argc, char **argv)
for (j = PFD_MAX; nfds > 0 && j < idx_peers; j++)
if (pfd[j].revents & (POLLIN|POLLERR)) {
nfds--;
- if (server_dispatch(pfd[j].fd, conf) == -1)
+ if (server_dispatch(pfd[j].fd, conf) == -1) {
+ log_warn("pipe write error (conf)");
ntp_quit = 1;
+ }
}
for (; nfds > 0 && j < idx_clients; j++) {
if (pfd[j].revents & (POLLIN|POLLERR)) {
nfds--;
if (client_dispatch(idx2peer[j - idx_peers],
- conf->settime) == -1)
+ conf->settime) == -1) {
+ log_warn("pipe write error (settime)");
ntp_quit = 1;
+ }
}
}