summaryrefslogtreecommitdiff
path: root/usr.sbin/radiusd/radiusd.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:17:04 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:17:04 +0000
commitcaba869c8447fc7ef9f32581e1d02262e51ec18a (patch)
treec06988b36b6677e805071a9673b04b5360e2e36d /usr.sbin/radiusd/radiusd.c
parent9c8d00dd06d79ba9fccf07c45cd1bdae73e744c5 (diff)
Rename imsg_init, imsg_clear, imsg_read, imsg_write and imsg_flush to
imsgbuf_init, imsgbuf_clear, imsgbuf_read, imsgbuf_write and imsgbuf_flush. This separates the imsgbuf API from the per-imsg API. OK tb@
Diffstat (limited to 'usr.sbin/radiusd/radiusd.c')
-rw-r--r--usr.sbin/radiusd/radiusd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/radiusd/radiusd.c b/usr.sbin/radiusd/radiusd.c
index db8795d890b..98e7033777f 100644
--- a/usr.sbin/radiusd/radiusd.c
+++ b/usr.sbin/radiusd/radiusd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radiusd.c,v 1.57 2024/11/21 13:16:07 claudio Exp $ */
+/* $OpenBSD: radiusd.c,v 1.58 2024/11/21 13:17:02 claudio Exp $ */
/*
* Copyright (c) 2013, 2023 Internet Initiative Japan Inc.
@@ -1200,7 +1200,7 @@ radiusd_module_load(struct radiusd *radiusd, const char *path, const char *name)
}
strlcpy(module->name, name, sizeof(module->name));
module->pid = pid;
- imsg_init(&module->ibuf, module->fd);
+ imsgbuf_init(&module->ibuf, module->fd);
if (imsg_sync_read(&module->ibuf, MODULE_IO_TIMEOUT) <= 0 ||
(n = imsg_get(&module->ibuf, &imsg)) <= 0) {
@@ -1301,7 +1301,7 @@ radiusd_module_close(struct radiusd_module *module)
{
if (module->fd >= 0) {
event_del(&module->ev);
- imsg_clear(&module->ibuf);
+ imsgbuf_clear(&module->ibuf);
close(module->fd);
module->fd = -1;
}
@@ -1322,9 +1322,9 @@ radiusd_module_on_imsg_io(int fd, short evmask, void *ctx)
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);
+ if (imsgbuf_write(&module->ibuf) == -1) {
+ log_warn("Failed to write to module `%s': "
+ "imsgbuf_write()", module->name);
goto on_error;
}
module->writeready = false;
@@ -1381,12 +1381,12 @@ radiusd_module_imsg_read(struct radiusd_module *module)
int n;
struct imsg imsg;
- if ((n = imsg_read(&module->ibuf)) == -1 || n == 0) {
+ if ((n = imsgbuf_read(&module->ibuf)) == -1 || n == 0) {
if (n == -1 && errno == EAGAIN)
return (0);
if (n == -1)
log_warn("Receiving a message from module `%s' "
- "failed: imsg_read", module->name);
+ "failed: imsgbuf_read", module->name);
/* else closed */
radiusd_module_close(module);
return (-1);