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/ldpd | |
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/ldpd')
-rw-r--r-- | usr.sbin/ldpd/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/ldpd/lde.c | 10 | ||||
-rw-r--r-- | usr.sbin/ldpd/ldpd.c | 10 | ||||
-rw-r--r-- | usr.sbin/ldpd/ldpe.c | 14 |
4 files changed, 19 insertions, 19 deletions
diff --git a/usr.sbin/ldpd/control.c b/usr.sbin/ldpd/control.c index 6b1518b33df..02574b79dee 100644 --- a/usr.sbin/ldpd/control.c +++ b/usr.sbin/ldpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.32 2023/03/08 04:43:13 guenther Exp $ */ +/* $OpenBSD: control.c,v 1.33 2024/11/21 13:10:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -210,7 +210,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/ldpd/lde.c b/usr.sbin/ldpd/lde.c index b16ad2ac2b5..0c0bc813f72 100644 --- a/usr.sbin/ldpd/lde.c +++ b/usr.sbin/ldpd/lde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lde.c,v 1.78 2024/04/23 13:34:51 jsg Exp $ */ +/* $OpenBSD: lde.c,v 1.79 2024/11/21 13:10:39 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -204,8 +204,8 @@ lde_dispatch_imsg(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; } @@ -399,8 +399,8 @@ lde_dispatch_parent(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/ldpd/ldpd.c b/usr.sbin/ldpd/ldpd.c index f9e3e66f6b8..9604abc87b4 100644 --- a/usr.sbin/ldpd/ldpd.c +++ b/usr.sbin/ldpd/ldpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpd.c,v 1.69 2023/03/08 04:43:13 guenther Exp $ */ +/* $OpenBSD: ldpd.c,v 1.70 2024/11/21 13:10:39 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -385,8 +385,8 @@ main_dispatch_ldpe(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) shut = 1; } @@ -464,8 +464,8 @@ main_dispatch_lde(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) shut = 1; } diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c index b69ec638149..1ebceba57c2 100644 --- a/usr.sbin/ldpd/ldpe.c +++ b/usr.sbin/ldpd/ldpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpe.c,v 1.82 2023/12/14 11:10:19 claudio Exp $ */ +/* $OpenBSD: ldpe.c,v 1.83 2024/11/21 13:10:39 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org> @@ -159,10 +159,10 @@ ldpe_shutdown(void) struct adj *adj; /* close pipes */ - msgbuf_write(&iev_lde->ibuf.w); + imsg_write(&iev_lde->ibuf); msgbuf_clear(&iev_lde->ibuf.w); close(iev_lde->ibuf.fd); - msgbuf_write(&iev_main->ibuf.w); + imsg_write(&iev_main->ibuf); msgbuf_clear(&iev_main->ibuf.w); close(iev_main->ibuf.fd); @@ -237,8 +237,8 @@ ldpe_dispatch_main(int fd, short event, void *bula) shut = 1; } if (event & EV_WRITE) { - if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN) - fatal("ldpe_dispatch_main: msgbuf_write"); + if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) + fatal("ldpe_dispatch_main: imsg_write"); if (n == 0) shut = 1; } @@ -501,8 +501,8 @@ ldpe_dispatch_lde(int fd, short event, void *bula) shut = 1; } if (event & EV_WRITE) { - if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN) - fatal("ldpe_dispatch_lde: msgbuf_write"); + if ((n = imsg_write(ibuf)) == -1 && errno != EAGAIN) + fatal("ldpe_dispatch_lde: imsg_write"); if (n == 0) shut = 1; } |