git: d5566d755694 - main - rpc.tlsservd: fix on a machine with just one CPU
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 21 May 2025 02:55:38 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=d5566d755694b0efeef9b0e0ff839ee5b3ef43bd
commit d5566d755694b0efeef9b0e0ff839ee5b3ef43bd
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-05-21 00:52:44 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-05-21 02:54:38 +0000
rpc.tlsservd: fix on a machine with just one CPU
Reported by: rmacklem
Fixes: 8e5f80da89d74a5ef429b34bb9c3f8b589f8da9a
---
usr.sbin/rpc.tlsservd/rpc.tlsservd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
index 438b745fb5de..f07385a2baa7 100644
--- a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
+++ b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
@@ -167,7 +167,8 @@ main(int argc, char **argv)
}
rpctls_verbose = false;
- rpctls_maxthreads = (ncpu = (u_int)sysconf(_SC_NPROCESSORS_ONLN)) / 2;
+ ncpu = (u_int)sysconf(_SC_NPROCESSORS_ONLN);
+ rpctls_maxthreads = ncpu > 1 ? ncpu / 2 : 1;
while ((ch = getopt_long(argc, argv, "2C:D:dhl:N:n:mp:r:uvWw", longopts,
NULL)) != -1) {