summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorBooker C. Bense <bbense@gmail.com>2013-08-19 18:14:05 (GMT)
committerBooker C. Bense <bbense@gmail.com>2013-08-19 18:14:05 (GMT)
commitf12edfd07384be4060d5c724ac38ee212adc9028 (patch)
tree099c7d0c1faac4670fe5b59d0f5b9e2f499f3f93 /plugins
parent64b4d1fb665005c9442361094e02cfd25aa15f43 (diff)
downloadmonitoring-plugins-f12edfd07384be4060d5c724ac38ee212adc9028.tar.gz
Bug fix for ncpus if hyperthreading turned off in linuxrefs/pull/62/head
Diffstat (limited to 'plugins')
-rw-r--r--plugins/common.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/common.h b/plugins/common.h
index c0dc2f4..858329f 100644
--- a/plugins/common.h
+++ b/plugins/common.h
@@ -82,10 +82,14 @@
82 getting that data 82 getting that data
83 Will return -1 if cannot get data 83 Will return -1 if cannot get data
84*/ 84*/
85#ifdef HAVE_SYSCONF__SC_NPROCESSORS_CONF 85#ifdef HAVE_SYSCONF__SC_NPROCESSORS_ONLN
86#define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF) 86#define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_ONLN)
87#else 87#else
88#define GET_NUMBER_OF_CPUS() -1 88# ifdef HAVE_SYSCONF__SC_NPROCESSORS_CONF
89# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF)
90# else
91# define GET_NUMBER_OF_CPUS() -1
92# endif
89#endif 93#endif
90 94
91#ifdef TIME_WITH_SYS_TIME 95#ifdef TIME_WITH_SYS_TIME