diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:10:58 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:10:58 +0000 |
commit | 6b0deb304b4f88788be43f9b689c006766cd0a30 (patch) | |
tree | 1a802a41ec15d85e5161dce51b6ab0c5ca229038 /usr.sbin/rad | |
parent | a423251e6ce072befee8d8b94b6a46d5438768d3 (diff) |
Introduce imsg_write() and use it instead of msgbuf_write().
imsg_write() is just a thin wrapper around msgbuf_write(). So this is
mostly search and replace.
OK tb@
Diffstat (limited to 'usr.sbin/rad')
-rw-r--r-- | usr.sbin/rad/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/rad/engine.c | 10 | ||||
-rw-r--r-- | usr.sbin/rad/frontend.c | 14 | ||||
-rw-r--r-- | usr.sbin/rad/rad.c | 10 |
4 files changed, 19 insertions, 19 deletions
diff --git a/usr.sbin/rad/control.c b/usr.sbin/rad/control.c index 435893aeda7..d2727528cf9 100644 --- a/usr.sbin/rad/control.c +++ b/usr.sbin/rad/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.8 2021/03/02 04:10:07 jsg Exp $ */ +/* $OpenBSD: control.c,v 1.9 2024/11/21 13:10:47 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -237,7 +237,7 @@ control_dispatch_imsg(int fd, short event, void *bula) } } if (event & EV_WRITE) { - if (msgbuf_write(&c->iev.ibuf.w) <= 0 && errno != EAGAIN) { + if (imsg_write(&c->iev.ibuf) <= 0 && errno != EAGAIN) { control_close(fd); return; } diff --git a/usr.sbin/rad/engine.c b/usr.sbin/rad/engine.c index 1205509d6ec..6847401aaea 100644 --- a/usr.sbin/rad/engine.c +++ b/usr.sbin/rad/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.22 2023/12/14 11:09:34 claudio Exp $ */ +/* $OpenBSD: engine.c,v 1.23 2024/11/21 13:10:47 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -200,8 +200,8 @@ engine_dispatch_frontend(int fd, short event, void *bula) shut = 1; } if (event & EV_WRITE) { - if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN) - fatal("msgbuf_write"); + if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) + fatal("imsg_write"); if (n == 0) /* Connection closed. */ shut = 1; } @@ -282,8 +282,8 @@ engine_dispatch_main(int fd, short event, void *bula) shut = 1; } if (event & EV_WRITE) { - if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN) - fatal("msgbuf_write"); + if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) + fatal("imsg_write"); if (n == 0) /* Connection closed. */ shut = 1; } diff --git a/usr.sbin/rad/frontend.c b/usr.sbin/rad/frontend.c index c700c079e6d..4ccbcde819f 100644 --- a/usr.sbin/rad/frontend.c +++ b/usr.sbin/rad/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.49 2024/07/02 17:41:27 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.50 2024/11/21 13:10:47 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -273,10 +273,10 @@ __dead void frontend_shutdown(void) { /* Close pipes. */ - msgbuf_write(&iev_engine->ibuf.w); + imsg_write(&iev_engine->ibuf); msgbuf_clear(&iev_engine->ibuf.w); close(iev_engine->ibuf.fd); - msgbuf_write(&iev_main->ibuf.w); + imsg_write(&iev_main->ibuf); msgbuf_clear(&iev_main->ibuf.w); close(iev_main->ibuf.fd); @@ -325,8 +325,8 @@ frontend_dispatch_main(int fd, short event, void *bula) shut = 1; } if (event & EV_WRITE) { - if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN) - fatal("msgbuf_write"); + if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) + fatal("imsg_write"); if (n == 0) /* Connection closed. */ shut = 1; } @@ -538,8 +538,8 @@ frontend_dispatch_engine(int fd, short event, void *bula) shut = 1; } if (event & EV_WRITE) { - if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN) - fatal("msgbuf_write"); + if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) + fatal("imsg_write"); if (n == 0) /* Connection closed. */ shut = 1; } diff --git a/usr.sbin/rad/rad.c b/usr.sbin/rad/rad.c index 036a73e1765..acce6cf714e 100644 --- a/usr.sbin/rad/rad.c +++ b/usr.sbin/rad/rad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rad.c,v 1.31 2024/05/21 05:00:48 jsg Exp $ */ +/* $OpenBSD: rad.c,v 1.32 2024/11/21 13:10:47 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -387,8 +387,8 @@ main_dispatch_frontend(int fd, short event, void *bula) shut = 1; } if (event & EV_WRITE) { - if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN) - fatal("msgbuf_write"); + if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) + fatal("imsg_write"); if (n == 0) /* Connection closed. */ shut = 1; } @@ -455,8 +455,8 @@ main_dispatch_engine(int fd, short event, void *bula) shut = 1; } if (event & EV_WRITE) { - if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN) - fatal("msgbuf_write"); + if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) + fatal("imsg_write"); if (n == 0) /* Connection closed. */ shut = 1; } |