diff options
Diffstat (limited to 'sbin/unwind')
-rw-r--r-- | sbin/unwind/control.c | 10 | ||||
-rw-r--r-- | sbin/unwind/frontend.c | 26 | ||||
-rw-r--r-- | sbin/unwind/resolver.c | 22 | ||||
-rw-r--r-- | sbin/unwind/unwind.c | 22 |
4 files changed, 40 insertions, 40 deletions
diff --git a/sbin/unwind/control.c b/sbin/unwind/control.c index abea0bae0b1..1284783e49e 100644 --- a/sbin/unwind/control.c +++ b/sbin/unwind/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.19 2024/11/21 13:14:45 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.20 2024/11/21 13:17:01 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -156,7 +156,7 @@ control_accept(int listenfd, short event, void *bula) return; } - imsg_init(&c->iev.ibuf, connfd); + imsgbuf_init(&c->iev.ibuf, connfd); c->iev.handler = control_dispatch_imsg; c->iev.events = EV_READ; event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events, c->iev.handler, @@ -233,14 +233,14 @@ control_dispatch_imsg(int fd, short event, void *bula) } if (event & EV_READ) { - if (((n = imsg_read(&c->iev.ibuf)) == -1 && errno != EAGAIN) || - n == 0) { + if (((n = imsgbuf_read(&c->iev.ibuf)) == -1 && + errno != EAGAIN) || n == 0) { control_close(fd); return; } } if (event & EV_WRITE) { - if (imsg_write(&c->iev.ibuf) == -1) { + if (imsgbuf_write(&c->iev.ibuf) == -1) { control_close(fd); return; } diff --git a/sbin/unwind/frontend.c b/sbin/unwind/frontend.c index bf731bf637e..8373d112e4e 100644 --- a/sbin/unwind/frontend.c +++ b/sbin/unwind/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.85 2024/11/21 13:14:45 claudio Exp $ */ +/* $OpenBSD: frontend.c,v 1.86 2024/11/21 13:17:01 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -233,7 +233,7 @@ frontend(int debug, int verbose) fatal("iev_main"); if ((iev_main = malloc(sizeof(struct imsgev))) == NULL) fatal(NULL); - imsg_init(&iev_main->ibuf, 3); + imsgbuf_init(&iev_main->ibuf, 3); iev_main->handler = frontend_dispatch_main; iev_main->events = EV_READ; event_set(&iev_main->ev, iev_main->ibuf.fd, iev_main->events, @@ -271,10 +271,10 @@ __dead void frontend_shutdown(void) { /* Close pipes. */ - imsg_write(&iev_resolver->ibuf); + imsgbuf_write(&iev_resolver->ibuf); msgbuf_clear(&iev_resolver->ibuf.w); close(iev_resolver->ibuf.fd); - imsg_write(&iev_main->ibuf); + imsgbuf_write(&iev_main->ibuf); msgbuf_clear(&iev_main->ibuf.w); close(iev_main->ibuf.fd); @@ -311,17 +311,17 @@ frontend_dispatch_main(int fd, short event, void *bula) int n, shut = 0; if (event & EV_READ) { - if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) - fatal("imsg_read error"); + if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; } if (event & EV_WRITE) { - if (imsg_write(ibuf) == -1) { + if (imsgbuf_write(ibuf) == -1) { if (errno == EPIPE) /* Connection closed. */ shut = 1; else - fatal("imsg_write"); + fatal("imsgbuf_write"); } } @@ -355,7 +355,7 @@ frontend_dispatch_main(int fd, short event, void *bula) if (iev_resolver == NULL) fatal(NULL); - imsg_init(&iev_resolver->ibuf, fd); + imsgbuf_init(&iev_resolver->ibuf, fd); iev_resolver->handler = frontend_dispatch_resolver; iev_resolver->events = EV_READ; @@ -492,17 +492,17 @@ frontend_dispatch_resolver(int fd, short event, void *bula) int n, shut = 0, chg; if (event & EV_READ) { - if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) - fatal("imsg_read error"); + if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; } if (event & EV_WRITE) { - if (imsg_write(ibuf) == -1) { + if (imsgbuf_write(ibuf) == -1) { if (errno == EPIPE) /* Connection closed. */ shut = 1; else - fatal("imsg_write"); + fatal("imsgbuf_write"); } } diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index e510fb98f2c..9485c28a8ba 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.169 2024/11/21 13:14:45 claudio Exp $ */ +/* $OpenBSD: resolver.c,v 1.170 2024/11/21 13:17:01 claudio Exp $ */ /* @@ -415,7 +415,7 @@ resolver(int debug, int verbose) if ((iev_main = malloc(sizeof(struct imsgev))) == NULL) fatal(NULL); - imsg_init(&iev_main->ibuf, 3); + imsgbuf_init(&iev_main->ibuf, 3); iev_main->handler = resolver_dispatch_main; /* Setup event handlers. */ @@ -495,17 +495,17 @@ resolver_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) - fatal("imsg_read error"); + if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; } if (event & EV_WRITE) { - if (imsg_write(ibuf) == -1) { + if (imsgbuf_write(ibuf) == -1) { if (errno == EPIPE) /* Connection closed. */ shut = 1; else - fatal("imsg_write"); + fatal("imsgbuf_write"); } } @@ -633,17 +633,17 @@ resolver_dispatch_main(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) - fatal("imsg_read error"); + if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; } if (event & EV_WRITE) { - if (imsg_write(ibuf) == -1) { + if (imsgbuf_write(ibuf) == -1) { if (errno == EPIPE) /* Connection closed. */ shut = 1; else - fatal("imsg_write"); + fatal("imsgbuf_write"); } } @@ -671,7 +671,7 @@ resolver_dispatch_main(int fd, short event, void *bula) if (iev_frontend == NULL) fatal(NULL); - imsg_init(&iev_frontend->ibuf, fd); + imsgbuf_init(&iev_frontend->ibuf, fd); iev_frontend->handler = resolver_dispatch_frontend; iev_frontend->events = EV_READ; diff --git a/sbin/unwind/unwind.c b/sbin/unwind/unwind.c index b2217bb7faf..7cfe6a77d57 100644 --- a/sbin/unwind/unwind.c +++ b/sbin/unwind/unwind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unwind.c,v 1.70 2024/11/21 13:14:45 claudio Exp $ */ +/* $OpenBSD: unwind.c,v 1.71 2024/11/21 13:17:01 claudio Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -239,9 +239,9 @@ main(int argc, char *argv[]) if ((iev_frontend = malloc(sizeof(struct imsgev))) == NULL || (iev_resolver = malloc(sizeof(struct imsgev))) == NULL) fatal(NULL); - imsg_init(&iev_frontend->ibuf, pipe_main2frontend[0]); + imsgbuf_init(&iev_frontend->ibuf, pipe_main2frontend[0]); iev_frontend->handler = main_dispatch_frontend; - imsg_init(&iev_resolver->ibuf, pipe_main2resolver[0]); + imsgbuf_init(&iev_resolver->ibuf, pipe_main2resolver[0]); iev_resolver->handler = main_dispatch_resolver; /* Setup event handlers for pipes. */ @@ -398,17 +398,17 @@ main_dispatch_frontend(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) - fatal("imsg_read error"); + if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; } if (event & EV_WRITE) { - if (imsg_write(ibuf) == -1) { + if (imsgbuf_write(ibuf) == -1) { if (errno == EPIPE) /* Connection closed. */ shut = 1; else - fatal("imsg_write"); + fatal("imsgbuf_write"); } } @@ -463,17 +463,17 @@ main_dispatch_resolver(int fd, short event, void *bula) ibuf = &iev->ibuf; if (event & EV_READ) { - if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN) - fatal("imsg_read error"); + if ((n = imsgbuf_read(ibuf)) == -1 && errno != EAGAIN) + fatal("imsgbuf_read error"); if (n == 0) /* Connection closed. */ shut = 1; } if (event & EV_WRITE) { - if (imsg_write(ibuf) == -1) { + if (imsgbuf_write(ibuf) == -1) { if (errno == EPIPE) /* Connection closed. */ shut = 1; else - fatal("imsg_write"); + fatal("imsgbuf_write"); } } |