From 8f10b8fece6f45c457059234fd765e080fad5d7b Mon Sep 17 00:00:00 2001 From: "roberto@opensuse12" Date: Wed, 25 Apr 2012 08:11:12 +0200 Subject: [PATCH] fix python version printing on freeky systems --- plugins/python/python_plugin.c | 2 +- uwsgi.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 2a2bf3b2..f26942e4 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -151,7 +151,7 @@ int uwsgi_python_init() { #ifndef UWSGI_PYPY char *pyversion = strchr(Py_GetVersion(), '\n'); if (!pyversion) { - uwsgi_log_initial("Python version: %s %s\n", Py_GetVersion(), Py_GetCompiler()+1); + uwsgi_log_initial("Python version: %s\n", Py_GetVersion()); } else { uwsgi_log_initial("Python version: %.*s %s\n", pyversion-Py_GetVersion(), Py_GetVersion(), Py_GetCompiler()+1); diff --git a/uwsgi.c b/uwsgi.c index 2641087b..b4b479dc 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -1654,6 +1654,12 @@ int main(int argc, char *argv[], char *envp[]) { uwsgi_log_initial("*** big endian arch detected ***\n"); #endif +#if defined(_SC_NPROCESSORS_ONLN) + uwsgi_log_initial("detected number of CPU cores: %d\n", sysconf(_SC_NPROCESSORS_ONLN)); +#elif defined(_SC_NPROCESSORS_CONF) + uwsgi_log_initial("detected number of CPU cores: %d\n", sysconf(_SC_NPROCESSORS_CONF)); +#endif + uwsgi_log_initial("current working directory: %s\n", uwsgi.cwd);