summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2024-09-15 05:14:33 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2024-09-15 05:14:33 +0000
commit3faea334c1f754566794b5cc2e0efcf677c96080 (patch)
tree7e9baf4c7f3c85c2a1f518e46a48ec31627ecafb /usr.sbin
parentf15862469826d947325d64313f16b255ee000c19 (diff)
Handle EAGAIN properly and fix the log when disconnected.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/radiusd/radiusd_module.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/radiusd/radiusd_module.c b/usr.sbin/radiusd/radiusd_module.c
index 02b3839626b..a666051e80c 100644
--- a/usr.sbin/radiusd/radiusd_module.c
+++ b/usr.sbin/radiusd/radiusd_module.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radiusd_module.c,v 1.19 2024/07/14 15:27:57 yasuoka Exp $ */
+/* $OpenBSD: radiusd_module.c,v 1.20 2024/09/15 05:14:32 yasuoka Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -643,9 +643,13 @@ module_on_event(int fd, short evmask, void *ctx)
if (ret > 0)
continue;
base->writeready = false;
- if (ret == 0 && errno == EAGAIN)
+ if (ret == -1 && errno == EAGAIN)
break;
- syslog(LOG_ERR, "%s: msgbuf_write: %m", __func__);
+ if (ret == 0)
+ syslog(LOG_ERR, "%s: connection is closed", __func__);
+ else
+ syslog(LOG_ERR, "%s: msgbuf_write: %d %m", __func__,
+ ret);
module_stop(base);
return;
}