Use msgbuf_queuelen() instead of accessing the queued member directly.
authorclaudio <claudio@openbsd.org>
Tue, 20 Aug 2024 13:31:49 +0000 (13:31 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 20 Aug 2024 13:31:49 +0000 (13:31 +0000)
OK tb@

usr.sbin/rpki-client/filemode.c
usr.sbin/rpki-client/http.c
usr.sbin/rpki-client/main.c
usr.sbin/rpki-client/parser.c
usr.sbin/rpki-client/rrdp.c
usr.sbin/rpki-client/rsync.c

index 93eb7ef..ef77ac0 100644 (file)
@@ -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 <claudio@openbsd.org>
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -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) {
index 78ee91e..cf6772e 100644 (file)
@@ -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 <nils_fisher@hotmail.com>
  * Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@@ -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;
index da095f9..7ff8949 100644 (file)
@@ -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 <claudio@openbsd.org>
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -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;
                }
 
index c11ec98..7f58a46 100644 (file)
@@ -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 <claudio@openbsd.org>
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -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) {
index 8fae02e..bf348d9 100644 (file)
@@ -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 <nils_fisher@hotmail.com>
  * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
@@ -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) {
index 33fe815..2a83b78 100644 (file)
@@ -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 <kristaps@bsd.lv>
  *
@@ -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) {