diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-04-19 23:15:38 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-04-19 23:17:49 +0400 |
commit | 0c13951b4684fe8a6eee0a88820a754903d520c4 (patch) | |
tree | 8fc03ab18717aa2579447f0994f5ad822614de2e /sysdeps | |
parent | b63c0307bf57bf949240b43b170e2becbab29528 (diff) | |
download | htop-master.tar.gz |
Fixed wrong value of this->cpuCount:
htop now shows processes again and does not crash on exit.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/linux.c | 6 | ||||
-rw-r--r-- | sysdeps/solaris.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/linux.c b/sysdeps/linux.c index 52b6e78..ab8710e 100644 --- a/sysdeps/linux.c +++ b/sysdeps/linux.c @@ -283,3 +283,9 @@ sysdep_uptime () } return (long) uptime; } + +int +sysdep_number_of_cpus () +{ + return sysconf (_SC_NPROCESSORS_ONLN); +} diff --git a/sysdeps/solaris.c b/sysdeps/solaris.c index 705ec9c..243975c 100644 --- a/sysdeps/solaris.c +++ b/sysdeps/solaris.c @@ -375,3 +375,9 @@ sysdep_uptime () } return uptime; } + +int +sysdep_number_of_cpus () +{ + return sysconf (_SC_NPROCESSORS_ONLN); +} |