summaryrefslogtreecommitdiff
path: root/usr.sbin/rpki-client/main.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:12:36 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:12:36 +0000
commit3d390a8bbbfa60898c28bb458da47b91b54287a8 (patch)
tree60cc4955c806aaac6a075361457f0319a9e70a26 /usr.sbin/rpki-client/main.c
parentf6c88a9535ada120880c3cc431d0bdf48df5be3f (diff)
Convert msgbuf_write() callers to the new return logic.
OK tb@
Diffstat (limited to 'usr.sbin/rpki-client/main.c')
-rw-r--r--usr.sbin/rpki-client/main.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c
index 13325062999..6d7867dc180 100644
--- a/usr.sbin/rpki-client/main.c
+++ b/usr.sbin/rpki-client/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.271 2024/11/14 10:28:59 tb Exp $ */
+/* $OpenBSD: main.c,v 1.272 2024/11/21 13:12:19 claudio Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1310,16 +1310,13 @@ main(int argc, char *argv[])
if (pfd[i].revents & POLLHUP)
hangup = 1;
if (pfd[i].revents & POLLOUT) {
- switch (msgbuf_write(queues[i])) {
- case 0:
- warnx("write[%d]: "
- "connection closed", i);
+ if (msgbuf_write(queues[i]) == -1) {
+ if (errno == EPIPE)
+ warnx("write[%d]: "
+ "connection closed", i);
+ else
+ warn("write[%d]", i);
hangup = 1;
- break;
- case -1:
- warn("write[%d]", i);
- hangup = 1;
- break;
}
}
}