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/radiusd/radiusd.c | |
parent | 2e2a93ef22aa29ad33b76ca24ca1ffc708c7d123 (diff) |
Convert imsg_write() callers to the new simplified return logic.
OK tb@
Diffstat (limited to 'usr.sbin/radiusd/radiusd.c')
-rw-r--r-- | usr.sbin/radiusd/radiusd.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/usr.sbin/radiusd/radiusd.c b/usr.sbin/radiusd/radiusd.c index 9fee0b41c61..db8795d890b 100644 --- a/usr.sbin/radiusd/radiusd.c +++ b/usr.sbin/radiusd/radiusd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radiusd.c,v 1.56 2024/11/21 13:10:48 claudio Exp $ */ +/* $OpenBSD: radiusd.c,v 1.57 2024/11/21 13:16:07 claudio Exp $ */ /* * Copyright (c) 2013, 2023 Internet Initiative Japan Inc. @@ -1319,27 +1319,22 @@ static void radiusd_module_on_imsg_io(int fd, short evmask, void *ctx) { struct radiusd_module *module = ctx; - int ret; - if (evmask & EV_WRITE) + if (evmask & EV_WRITE) { module->writeready = true; + if (imsg_write(&module->ibuf) == -1) { + log_warn("Failed to write to module `%s': imsg_write()", + module->name); + goto on_error; + } + module->writeready = false; + } if (evmask & EV_READ) { if (radiusd_module_imsg_read(module) == -1) goto on_error; } - while (module->writeready && module->ibuf.w.queued) { - ret = imsg_write(&module->ibuf); - if (ret > 0) - continue; - module->writeready = false; - if (ret == 0 && errno == EAGAIN) - break; - log_warn("Failed to write to module `%s': imsg_write()", - module->name); - goto on_error; - } radiusd_module_reset_ev_handler(module); return; |