summaryrefslogtreecommitdiff
path: root/usr.sbin/ripd/ripd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ripd/ripd.c')
-rw-r--r--usr.sbin/ripd/ripd.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/usr.sbin/ripd/ripd.c b/usr.sbin/ripd/ripd.c
index 96cca81c873..83f4a713a9b 100644
--- a/usr.sbin/ripd/ripd.c
+++ b/usr.sbin/ripd/ripd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripd.c,v 1.38 2024/11/21 13:10:50 claudio Exp $ */
+/* $OpenBSD: ripd.c,v 1.39 2024/11/21 13:16:07 claudio Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -320,10 +320,12 @@ main_dispatch_ripe(int fd, short event, void *bula)
shut = 1;
}
if (event & EV_WRITE) {
- if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN)
- fatal("imsg_write");
- if (n == 0) /* connection closed */
- shut = 1;
+ if (imsg_write(ibuf) == -1) {
+ if (errno == EPIPE) /* connection closed */
+ shut = 1;
+ else
+ fatal("imsg_write");
+ }
}
for (;;) {
@@ -398,10 +400,12 @@ main_dispatch_rde(int fd, short event, void *bula)
shut = 1;
}
if (event & EV_WRITE) {
- if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN)
- fatal("imsg_write");
- if (n == 0) /* connection closed */
- shut = 1;
+ if (imsg_write(ibuf) == -1) {
+ if (errno == EPIPE) /* connection closed */
+ shut = 1;
+ else
+ fatal("imsg_write");
+ }
}
for (;;) {