summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:16:08 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:16:08 +0000
commit9c8d00dd06d79ba9fccf07c45cd1bdae73e744c5 (patch)
tree9dbbc9d2f725d8ee1474850be3abaff593b88fe4 /usr.sbin/bgpd
parent2e2a93ef22aa29ad33b76ca24ca1ffc708c7d123 (diff)
Convert imsg_write() callers to the new simplified return logic.
OK tb@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/bgpd.c4
-rw-r--r--usr.sbin/bgpd/control.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index 493d2249c57..9d92a18ca36 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.271 2024/11/21 13:10:26 claudio Exp $ */
+/* $OpenBSD: bgpd.c,v 1.272 2024/11/21 13:16:06 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1273,7 +1273,7 @@ handle_pollfd(struct pollfd *pfd, struct imsgbuf *i)
return (0);
if (pfd->revents & POLLOUT)
- if (imsg_write(i) <= 0 && errno != EAGAIN) {
+ if (imsg_write(i) == -1) {
log_warn("imsg write error");
close(i->fd);
i->fd = -1;
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index 2fc6c04273a..5bd1464cd98 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.122 2024/11/21 13:10:26 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.123 2024/11/21 13:16:06 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -249,7 +249,7 @@ control_dispatch_msg(struct pollfd *pfd, struct peer_head *peers)
}
if (pfd->revents & POLLOUT) {
- if (imsg_write(&c->imsgbuf) <= 0 && errno != EAGAIN)
+ if (imsg_write(&c->imsgbuf) == -1)
return control_close(c);
if (c->throttled && c->imsgbuf.w.queued < CTL_MSG_LOW_MARK) {
if (imsg_ctl_rde_msg(IMSG_XON, 0, c->imsgbuf.pid) != -1)