diff options
Diffstat (limited to 'usr.sbin/ripd/rde.c')
-rw-r--r-- | usr.sbin/ripd/rde.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/usr.sbin/ripd/rde.c b/usr.sbin/ripd/rde.c index 7cbb704c942..c27debabbd3 100644 --- a/usr.sbin/ripd/rde.c +++ b/usr.sbin/ripd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.26 2024/11/21 13:10:50 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.27 2024/11/21 13:16:07 claudio Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -203,10 +203,12 @@ rde_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 (;;) { @@ -304,10 +306,12 @@ rde_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 (;;) { |