summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd/lde.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ldpd/lde.c')
-rw-r--r--usr.sbin/ldpd/lde.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/usr.sbin/ldpd/lde.c b/usr.sbin/ldpd/lde.c
index 0c0bc813f72..97bfc2c3920 100644
--- a/usr.sbin/ldpd/lde.c
+++ b/usr.sbin/ldpd/lde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lde.c,v 1.79 2024/11/21 13:10:39 claudio Exp $ */
+/* $OpenBSD: lde.c,v 1.80 2024/11/21 13:16:07 claudio Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@@ -204,10 +204,12 @@ lde_dispatch_imsg(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 (;;) {
@@ -399,10 +401,12 @@ lde_dispatch_parent(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 (;;) {