Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 May 2025 02:55:38 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d5566d755694 - main - rpc.tlsservd: fix on a machine with just one CPU
Message-ID:  <202505210255.54L2tcGP001536@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505210255.54L2tcGP001536>