rpc.tlsservd: fix on a machine with just one CPU

Reported by:		rmacklem
Fixes:			8e5f80da89
This commit is contained in:
Gleb Smirnoff 2025-05-20 17:52:44 -07:00
parent 137de4b34d
commit d5566d7556

View file

@ -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) {