diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:16:08 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:16:08 +0000 |
commit | 9c8d00dd06d79ba9fccf07c45cd1bdae73e744c5 (patch) | |
tree | 9dbbc9d2f725d8ee1474850be3abaff593b88fe4 /usr.sbin/ntpd | |
parent | 2e2a93ef22aa29ad33b76ca24ca1ffc708c7d123 (diff) |
Convert imsg_write() callers to the new simplified return logic.
OK tb@
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r-- | usr.sbin/ntpd/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/ntpd/ntp.c | 8 | ||||
-rw-r--r-- | usr.sbin/ntpd/ntp_dns.c | 5 | ||||
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 4 |
4 files changed, 9 insertions, 12 deletions
diff --git a/usr.sbin/ntpd/control.c b/usr.sbin/ntpd/control.c index c3bcd6ee787..634ab902d29 100644 --- a/usr.sbin/ntpd/control.c +++ b/usr.sbin/ntpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.22 2024/11/21 13:10:44 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.23 2024/11/21 13:16:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -207,7 +207,7 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt) } if (pfd->revents & POLLOUT) - if (imsg_write(&c->ibuf) <= 0 && errno != EAGAIN) { + if (imsg_write(&c->ibuf) == -1) { *ctl_cnt -= control_close(pfd->fd); return (1); } diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c index 18897f70e25..cfbb7543d57 100644 --- a/usr.sbin/ntpd/ntp.c +++ b/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.175 2024/11/21 13:10:44 claudio Exp $ */ +/* $OpenBSD: ntp.c,v 1.176 2024/11/21 13:16:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -365,8 +365,7 @@ ntp_main(struct ntpd_conf *nconf, struct passwd *pw, int argc, char **argv) } if (nfds > 0 && (pfd[PFD_PIPE_MAIN].revents & POLLOUT)) - if (imsg_write(ibuf_main) <= 0 && - errno != EAGAIN) { + if (imsg_write(ibuf_main) == -1) { log_warn("pipe write error (to parent)"); ntp_quit = 1; } @@ -380,8 +379,7 @@ ntp_main(struct ntpd_conf *nconf, struct passwd *pw, int argc, char **argv) } if (nfds > 0 && (pfd[PFD_PIPE_DNS].revents & POLLOUT)) - if (imsg_write(ibuf_dns) <= 0 && - errno != EAGAIN) { + if (imsg_write(ibuf_dns) == -1) { log_warn("pipe write error (to dns engine)"); ntp_quit = 1; } diff --git a/usr.sbin/ntpd/ntp_dns.c b/usr.sbin/ntpd/ntp_dns.c index d1670970991..3f9813b644e 100644 --- a/usr.sbin/ntpd/ntp_dns.c +++ b/usr.sbin/ntpd/ntp_dns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp_dns.c,v 1.30 2024/11/21 13:10:44 claudio Exp $ */ +/* $OpenBSD: ntp_dns.c,v 1.31 2024/11/21 13:16:07 claudio Exp $ */ /* * Copyright (c) 2003-2008 Henning Brauer <henning@openbsd.org> @@ -117,8 +117,7 @@ ntp_dns(struct ntpd_conf *nconf, struct passwd *pw) } if (nfds > 0 && (pfd[0].revents & POLLOUT)) - if (imsg_write(ibuf_dns) <= 0 && - errno != EAGAIN) { + if (imsg_write(ibuf_dns) == -1) { log_warn("pipe write error (to ntp engine)"); quit_dns = 1; } diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index 8e13a071d25..33a7fe049b3 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.135 2024/11/21 13:10:44 claudio Exp $ */ +/* $OpenBSD: ntpd.c,v 1.136 2024/11/21 13:16:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -333,7 +333,7 @@ main(int argc, char *argv[]) } if (nfds > 0 && (pfd[PFD_PIPE].revents & POLLOUT)) - if (imsg_write(ibuf) <= 0 && errno != EAGAIN) { + if (imsg_write(ibuf) == -1) { log_warn("pipe write error (to child)"); quit = 1; } |