27 Jun
2011
27 Jun
'11
8:53 a.m.
[threading] It is possible that the _SC_NPROCESSORS_ONLN isn't defined. In this case the max threads must greater than 0 Signed-off-by: Viktor Juhasz <jviktor@balabit.hu> diff --git a/lib/mainloop.c b/lib/mainloop.c index e659fff..b23d055 100644 --- a/lib/mainloop.c +++ b/lib/mainloop.c @@ -702,6 +702,8 @@ main_loop_add_options(GOptionContext *ctx) { #ifdef _SC_NPROCESSORS_ONLN main_loop_io_workers.max_threads = MIN(MAX(2, sysconf(_SC_NPROCESSORS_ONLN)), 64); +#else + main_loop_io_workers.max_threads = 2; #endif g_option_context_add_main_entries(ctx, main_loop_options, NULL);