summaryrefslogtreecommitdiff
path: root/usr.sbin/radiusd/radiusd_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/radiusd/radiusd_file.c')
-rw-r--r--usr.sbin/radiusd/radiusd_file.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/radiusd/radiusd_file.c b/usr.sbin/radiusd/radiusd_file.c
index 550638b53bd..895c3ed767e 100644
--- a/usr.sbin/radiusd/radiusd_file.c
+++ b/usr.sbin/radiusd/radiusd_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radiusd_file.c,v 1.5 2024/07/18 22:40:09 yasuoka Exp $ */
+/* $OpenBSD: radiusd_file.c,v 1.6 2024/11/21 13:17:02 claudio Exp $ */
/*
* Copyright (c) 2024 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -128,7 +128,7 @@ main(int argc, char *argv[])
if (pledge("stdio rpath unveil", NULL) == -1)
err(EXIT_FAILURE, "pledge");
setproctitle("[priv]");
- imsg_init(&ibuf, pairsock[0]);
+ imsgbuf_init(&ibuf, pairsock[0]);
/* Receive parameters from the main process. */
if (imsg_sync_read(&ibuf, 2000) <= 0 ||
@@ -158,7 +158,7 @@ main(int argc, char *argv[])
memcpy(&params, paramsp, sizeof(params));
for (;;) {
- if ((n = imsg_read(&ibuf)) <= 0 && errno != EAGAIN)
+ if ((n = imsgbuf_read(&ibuf)) <= 0 && errno != EAGAIN)
break;
for (;;) {
if ((n = imsg_get(&ibuf, &imsg)) == -1)
@@ -167,11 +167,11 @@ main(int argc, char *argv[])
break;
parent_dispatch_main(&params, &ibuf, &imsg);
imsg_free(&imsg);
- imsg_flush(&ibuf);
+ imsgbuf_flush(&ibuf);
}
- imsg_flush(&ibuf);
+ imsgbuf_flush(&ibuf);
}
- imsg_clear(&ibuf);
+ imsgbuf_clear(&ibuf);
while (waitpid(pid, &status, 0) == -1) {
if (errno != EINTR)
@@ -244,7 +244,7 @@ module_file_main(void)
module_drop_privilege(module_file.base, 0);
module_load(module_file.base);
- imsg_init(&module_file.ibuf, 3);
+ imsgbuf_init(&module_file.ibuf, 3);
if (pledge("stdio", NULL) == -1)
err(EXIT_FAILURE, "pledge");
@@ -331,7 +331,7 @@ module_file_start(void *ctx)
}
imsg_compose(&module->ibuf, IMSG_RADIUSD_FILE_PARAMS, 0, -1, -1,
&module->params, sizeof(module->params));
- imsg_flush(&module->ibuf);
+ imsgbuf_flush(&module->ibuf);
module_send_message(module->base, IMSG_OK, NULL);
}
@@ -359,9 +359,9 @@ module_file_access_request(void *ctx, u_int query_id, const u_char *pkt,
imsg_compose(&self->ibuf, IMSG_RADIUSD_FILE_USERINFO, 0, -1, -1,
username, strlen(username) + 1);
- imsg_flush(&self->ibuf);
- if ((n = imsg_read(&self->ibuf)) == -1 || n == 0) {
- log_warn("%s: imsg_read()", __func__);
+ imsgbuf_flush(&self->ibuf);
+ if ((n = imsgbuf_read(&self->ibuf)) == -1 || n == 0) {
+ log_warn("%s: imsgbuf_read()", __func__);
goto out;
}
if ((n = imsg_get(&self->ibuf, &imsg)) <= 0) {