diff options
Diffstat (limited to 'accel-pppd/triton')
-rw-r--r-- | accel-pppd/triton/triton.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c index 897a4ea..267cc2b 100644 --- a/accel-pppd/triton/triton.c +++ b/accel-pppd/triton/triton.c @@ -617,6 +617,14 @@ void __export triton_run() opt = conf_get_opt("core", "thread-count"); if (opt && atoi(opt) > 0) thread_count = atoi(opt); + else { + thread_count = sysconf(_SC_NPROCESSORS_ONLN); + if (thread_count < 0) { + triton_log_error("sysconf(_SC_NPROCESSORS_ONLN)" + " failed: %s\n", strerror(errno)); + thread_count = 2; + } + } opt = conf_get_opt("core", "thread-count-max"); if (opt && atoi(opt) > 0) |