[PATCH] Fix: maximum thread number can be 0
[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);
On Mon, 2011-06-27 at 09:53 +0200, Juhasz Viktor wrote:
[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>
thanks, applied. -- Bazsi
participants (2)
-
Balazs Scheidler
-
Juhasz Viktor