summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:28:55 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:28:55 +0000
commit94b4ab6477f7a9800d77232563fa206c1ee8a907 (patch)
tree435b6b5461b61f0d45317fe18b5e6719c7f9f439
parentd4c259af8b5a77d599c11a2f0611ab1cfb868044 (diff)
Adjust rpki-client to the new msgbuf_write api
OK tb@
-rw-r--r--usr.sbin/rpki-client/filemode.c6
-rw-r--r--usr.sbin/rpki-client/http.c5
-rw-r--r--usr.sbin/rpki-client/main.c8
-rw-r--r--usr.sbin/rpki-client/parser.c5
-rw-r--r--usr.sbin/rpki-client/rrdp.c5
-rw-r--r--usr.sbin/rpki-client/rsync.c7
6 files changed, 13 insertions, 23 deletions
diff --git a/usr.sbin/rpki-client/filemode.c b/usr.sbin/rpki-client/filemode.c
index bd03d993b13..72999f47763 100644
--- a/usr.sbin/rpki-client/filemode.c
+++ b/usr.sbin/rpki-client/filemode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: filemode.c,v 1.53 2024/11/21 13:12:19 claudio Exp $ */
+/* $OpenBSD: filemode.c,v 1.54 2024/11/21 13:28:54 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -749,8 +749,6 @@ proc_filemode(int fd)
TAILQ_INIT(&q);
msgbuf_init(&msgq);
- msgq.fd = fd;
-
pfd.fd = fd;
for (;;) {
@@ -784,7 +782,7 @@ proc_filemode(int fd)
}
if (pfd.revents & POLLOUT) {
- if (msgbuf_write(&msgq) == -1) {
+ if (msgbuf_write(fd, &msgq) == -1) {
if (errno == EPIPE)
errx(1, "write: connection closed");
else
diff --git a/usr.sbin/rpki-client/http.c b/usr.sbin/rpki-client/http.c
index e6262742d89..ba5a6d3eabc 100644
--- a/usr.sbin/rpki-client/http.c
+++ b/usr.sbin/rpki-client/http.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: http.c,v 1.89 2024/11/21 13:12:19 claudio Exp $ */
+/* $OpenBSD: http.c,v 1.90 2024/11/21 13:28:54 claudio Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@@ -2067,7 +2067,6 @@ proc_http(char *bind_addr, int fd)
err(1, "pledge");
msgbuf_init(&msgq);
- msgq.fd = fd;
for (;;) {
time_t now;
@@ -2138,7 +2137,7 @@ proc_http(char *bind_addr, int fd)
if (pfds[0].revents & POLLHUP)
break;
if (pfds[0].revents & POLLOUT) {
- if (msgbuf_write(&msgq) == -1) {
+ if (msgbuf_write(fd, &msgq) == -1) {
if (errno == EPIPE)
errx(1, "write: connection closed");
else
diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c
index 6d7867dc180..b5c6250fda1 100644
--- a/usr.sbin/rpki-client/main.c
+++ b/usr.sbin/rpki-client/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.272 2024/11/21 13:12:19 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.273 2024/11/21 13:28:54 claudio Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1235,10 +1235,6 @@ main(int argc, char *argv[])
msgbuf_init(&rsyncq);
msgbuf_init(&httpq);
msgbuf_init(&rrdpq);
- procq.fd = procfd;
- rsyncq.fd = rsyncfd;
- httpq.fd = httpfd;
- rrdpq.fd = rrdpfd;
/*
* The main process drives the top-down scan to leaf ROAs using
@@ -1310,7 +1306,7 @@ main(int argc, char *argv[])
if (pfd[i].revents & POLLHUP)
hangup = 1;
if (pfd[i].revents & POLLOUT) {
- if (msgbuf_write(queues[i]) == -1) {
+ if (msgbuf_write(pfd[i].fd, queues[i]) == -1) {
if (errno == EPIPE)
warnx("write[%d]: "
"connection closed", i);
diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c
index 1512028439b..29ff2506d2c 100644
--- a/usr.sbin/rpki-client/parser.c
+++ b/usr.sbin/rpki-client/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.145 2024/11/21 13:12:19 claudio Exp $ */
+/* $OpenBSD: parser.c,v 1.146 2024/11/21 13:28:54 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1071,7 +1071,6 @@ proc_parser(int fd)
TAILQ_INIT(&q);
msgbuf_init(&msgq);
- msgq.fd = fd;
pfd.fd = fd;
@@ -1106,7 +1105,7 @@ proc_parser(int fd)
}
if (pfd.revents & POLLOUT) {
- if (msgbuf_write(&msgq) == -1) {
+ if (msgbuf_write(fd, &msgq) == -1) {
if (errno == EPIPE)
errx(1, "write: connection closed");
else
diff --git a/usr.sbin/rpki-client/rrdp.c b/usr.sbin/rpki-client/rrdp.c
index 4e2f7142e35..b480e020f0d 100644
--- a/usr.sbin/rpki-client/rrdp.c
+++ b/usr.sbin/rpki-client/rrdp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rrdp.c,v 1.36 2024/11/21 13:12:19 claudio Exp $ */
+/* $OpenBSD: rrdp.c,v 1.37 2024/11/21 13:28:54 claudio Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
@@ -544,7 +544,6 @@ proc_rrdp(int fd)
err(1, "pledge");
msgbuf_init(&msgq);
- msgq.fd = fd;
for (;;) {
i = 1;
@@ -597,7 +596,7 @@ proc_rrdp(int fd)
if (pfds[0].revents & POLLHUP)
break;
if (pfds[0].revents & POLLOUT) {
- if (msgbuf_write(&msgq) == -1) {
+ if (msgbuf_write(fd, &msgq) == -1) {
if (errno == EPIPE)
errx(1, "write: connection closed");
else
diff --git a/usr.sbin/rpki-client/rsync.c b/usr.sbin/rpki-client/rsync.c
index 6fa439a4b57..8ef188c7504 100644
--- a/usr.sbin/rpki-client/rsync.c
+++ b/usr.sbin/rpki-client/rsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsync.c,v 1.53 2024/11/21 13:12:19 claudio Exp $ */
+/* $OpenBSD: rsync.c,v 1.54 2024/11/21 13:28:54 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -234,9 +234,8 @@ proc_rsync(char *prog, char *bind_addr, int fd)
if (pledge("stdio rpath proc exec unveil", NULL) == -1)
err(1, "pledge");
- pfd.fd = fd;
msgbuf_init(&msgq);
- msgq.fd = fd;
+ pfd.fd = fd;
/*
* Unveil the command we want to run.
@@ -355,7 +354,7 @@ proc_rsync(char *prog, char *bind_addr, int fd)
}
if (pfd.revents & POLLOUT) {
- if (msgbuf_write(&msgq) == -1) {
+ if (msgbuf_write(fd, &msgq) == -1) {
if (errno == EPIPE)
errx(1, "write: connection closed");
else