From 53f63e9d4418de4be4e29c8105cae525f674d50e Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 20 Aug 2024 13:31:49 +0000 Subject: [PATCH] Use msgbuf_queuelen() instead of accessing the queued member directly. OK tb@ --- usr.sbin/rpki-client/filemode.c | 4 ++-- usr.sbin/rpki-client/http.c | 4 ++-- usr.sbin/rpki-client/main.c | 4 ++-- usr.sbin/rpki-client/parser.c | 4 ++-- usr.sbin/rpki-client/rrdp.c | 4 ++-- usr.sbin/rpki-client/rsync.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/usr.sbin/rpki-client/filemode.c b/usr.sbin/rpki-client/filemode.c index 93eb7ef3ee2..ef77ac0070a 100644 --- a/usr.sbin/rpki-client/filemode.c +++ b/usr.sbin/rpki-client/filemode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: filemode.c,v 1.48 2024/07/25 08:44:39 tb Exp $ */ +/* $OpenBSD: filemode.c,v 1.49 2024/08/20 13:31:49 claudio Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -731,7 +731,7 @@ proc_filemode(int fd) for (;;) { pfd.events = POLLIN; - if (msgq.queued) + if (msgbuf_queuelen(&msgq) > 0) pfd.events |= POLLOUT; if (poll(&pfd, 1, INFTIM) == -1) { diff --git a/usr.sbin/rpki-client/http.c b/usr.sbin/rpki-client/http.c index 78ee91e5705..cf6772e1f6f 100644 --- a/usr.sbin/rpki-client/http.c +++ b/usr.sbin/rpki-client/http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: http.c,v 1.85 2024/04/23 10:27:46 tb Exp $ */ +/* $OpenBSD: http.c,v 1.86 2024/08/20 13:31:49 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2020 Claudio Jeker @@ -2077,7 +2077,7 @@ proc_http(char *bind_addr, int fd) memset(&pfds, 0, sizeof(pfds)); pfds[0].fd = fd; pfds[0].events = POLLIN; - if (msgq.queued) + if (msgbuf_queuelen(&msgq) > 0) pfds[0].events |= POLLOUT; i = 1; diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c index da095f9cfea..7ff894915fa 100644 --- a/usr.sbin/rpki-client/main.c +++ b/usr.sbin/rpki-client/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.263 2024/08/15 09:22:12 claudio Exp $ */ +/* $OpenBSD: main.c,v 1.264 2024/08/20 13:31:49 claudio Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -1289,7 +1289,7 @@ main(int argc, char *argv[]) for (i = 0; i < NPFD; i++) { pfd[i].events = POLLIN; - if (queues[i]->queued) + if (msgbuf_queuelen(queues[i]) > 0) pfd[i].events |= POLLOUT; } diff --git a/usr.sbin/rpki-client/parser.c b/usr.sbin/rpki-client/parser.c index c11ec98fd25..7f58a46008c 100644 --- a/usr.sbin/rpki-client/parser.c +++ b/usr.sbin/rpki-client/parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parser.c,v 1.141 2024/06/12 10:03:09 tb Exp $ */ +/* $OpenBSD: parser.c,v 1.142 2024/08/20 13:31:49 claudio Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -1056,7 +1056,7 @@ proc_parser(int fd) for (;;) { pfd.events = POLLIN; - if (msgq.queued) + if (msgbuf_queuelen(&msgq) > 0) pfd.events |= POLLOUT; if (poll(&pfd, 1, INFTIM) == -1) { diff --git a/usr.sbin/rpki-client/rrdp.c b/usr.sbin/rpki-client/rrdp.c index 8fae02e894c..bf348d951e2 100644 --- a/usr.sbin/rpki-client/rrdp.c +++ b/usr.sbin/rpki-client/rrdp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rrdp.c,v 1.33 2024/02/16 11:46:57 tb Exp $ */ +/* $OpenBSD: rrdp.c,v 1.34 2024/08/20 13:31:49 claudio Exp $ */ /* * Copyright (c) 2020 Nils Fisher * Copyright (c) 2021 Claudio Jeker @@ -585,7 +585,7 @@ proc_rrdp(int fd) */ pfds[0].fd = fd; pfds[0].events = POLLIN; - if (msgq.queued) + if (msgbuf_queuelen(&msgq) > 0) pfds[0].events |= POLLOUT; if (poll(pfds, i, INFTIM) == -1) { diff --git a/usr.sbin/rpki-client/rsync.c b/usr.sbin/rpki-client/rsync.c index 33fe81541b7..2a83b78bfea 100644 --- a/usr.sbin/rpki-client/rsync.c +++ b/usr.sbin/rpki-client/rsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsync.c,v 1.50 2024/03/22 03:38:12 job Exp $ */ +/* $OpenBSD: rsync.c,v 1.51 2024/08/20 13:31:49 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -294,7 +294,7 @@ proc_rsync(char *prog, char *bind_addr, int fd) pfd.events = 0; pfd.events |= POLLIN; - if (msgq.queued) + if (msgbuf_queuelen(&msgq) > 0) pfd.events |= POLLOUT; if (npending > 0 && nprocs < MAX_RSYNC_REQUESTS) { -- 2.20.1