summaryrefslogtreecommitdiff
path: root/usr.sbin/ractl
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:09:07 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:09:07 +0000
commita423251e6ce072befee8d8b94b6a46d5438768d3 (patch)
tree90355c86d050d127888df097c088f45eb7c9edd4 /usr.sbin/ractl
parent5eeda5072225febdb498941a3e2bdcda5694cb64 (diff)
Use imsg_flush() instead of implementing the same by hand.
OK tb@
Diffstat (limited to 'usr.sbin/ractl')
-rw-r--r--usr.sbin/ractl/ractl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/ractl/ractl.c b/usr.sbin/ractl/ractl.c
index 39fefa4b8c3..146d44408be 100644
--- a/usr.sbin/ractl/ractl.c
+++ b/usr.sbin/ractl/ractl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ractl.c,v 1.3 2021/02/27 10:35:20 florian Exp $ */
+/* $OpenBSD: ractl.c,v 1.4 2024/11/21 13:08:59 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -123,9 +123,8 @@ main(int argc, char *argv[])
usage();
}
- while (ibuf->w.queued)
- if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
- err(1, "write error");
+ if (imsg_flush(ibuf) == -1)
+ err(1, "write error");
while (!done) {
if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)