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/ypldap/ypldap.c | |
parent | 2e2a93ef22aa29ad33b76ca24ca1ffc708c7d123 (diff) |
Convert imsg_write() callers to the new simplified return logic.
OK tb@
Diffstat (limited to 'usr.sbin/ypldap/ypldap.c')
-rw-r--r-- | usr.sbin/ypldap/ypldap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/ypldap/ypldap.c b/usr.sbin/ypldap/ypldap.c index cfe305651cd..6ff15ae9b44 100644 --- a/usr.sbin/ypldap/ypldap.c +++ b/usr.sbin/ypldap/ypldap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypldap.c,v 1.26 2024/11/21 13:10:57 claudio Exp $ */ +/* $OpenBSD: ypldap.c,v 1.27 2024/11/21 13:16:07 claudio Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -367,11 +367,12 @@ main_dispatch_client(int fd, short events, void *p) shut = 1; } if (events & EV_WRITE) { - if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) - fatal("imsg_write"); - if (n == 0) - shut = 1; - goto done; + if (imsg_write(ibuf) == -1) { + if (errno == EPIPE) /* connection closed */ + shut = 1; + else + fatal("imsg_write"); + } } for (;;) { @@ -451,7 +452,6 @@ main_dispatch_client(int fd, short events, void *p) imsg_free(&imsg); } -done: if (!shut) imsg_event_add(iev); else { |