Fixing uninitialized ncpu value on unsupported platforms.

Thanks to @geyslan.

This closes #455 issue on GitHub.
This commit is contained in:
Max Romanov
2020-10-14 18:41:31 +03:00
parent 9dcb7ec4b7
commit d8628a43d0

View File

@@ -91,9 +91,12 @@ nxt_lib_start(const char *app, char **argv, char ***envp)
#elif (NXT_HPUX) #elif (NXT_HPUX)
n = mpctl(MPC_GETNUMSPUS, NULL, NULL); n = mpctl(MPC_GETNUMSPUS, NULL, NULL);
#else
n = 0;
#endif #endif
nxt_debug(&nxt_main_task, "ncpu: %ui", n); nxt_debug(&nxt_main_task, "ncpu: %d", n);
if (n > 1) { if (n > 1) {
nxt_ncpu = n; nxt_ncpu = n;