From d8628a43d0705deeb3473faf0252288038defc2b Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Wed, 14 Oct 2020 18:41:31 +0300 Subject: [PATCH] Fixing uninitialized ncpu value on unsupported platforms. Thanks to @geyslan. This closes #455 issue on GitHub. --- src/nxt_lib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nxt_lib.c b/src/nxt_lib.c index 1634a2b8..aba07dda 100644 --- a/src/nxt_lib.c +++ b/src/nxt_lib.c @@ -91,9 +91,12 @@ nxt_lib_start(const char *app, char **argv, char ***envp) #elif (NXT_HPUX) n = mpctl(MPC_GETNUMSPUS, NULL, NULL); +#else + n = 0; + #endif - nxt_debug(&nxt_main_task, "ncpu: %ui", n); + nxt_debug(&nxt_main_task, "ncpu: %d", n); if (n > 1) { nxt_ncpu = n;