summaryrefslogtreecommitdiffstats
path: root/sys-utils/chcpu.c
diff options
context:
space:
mode:
authorKarel Zak2012-02-01 12:26:20 +0100
committerKarel Zak2012-02-01 12:26:32 +0100
commit701e2b8e53a00e4006f733c46442871e4cd8e6c0 (patch)
tree423074392c0aa6451ceb5330f5282ef628fe4f19 /sys-utils/chcpu.c
parentcfdisk: wctomb() returns -1 on error (diff)
downloadkernel-qcow2-util-linux-701e2b8e53a00e4006f733c46442871e4cd8e6c0.tar.gz
kernel-qcow2-util-linux-701e2b8e53a00e4006f733c46442871e4cd8e6c0.tar.xz
kernel-qcow2-util-linux-701e2b8e53a00e4006f733c46442871e4cd8e6c0.zip
chcpu: check get_max_number_of_cpus() result properly
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/chcpu.c')
-rw-r--r--sys-utils/chcpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c
index 475c1cec6..29b7ab896 100644
--- a/sys-utils/chcpu.c
+++ b/sys-utils/chcpu.c
@@ -248,7 +248,7 @@ int main(int argc, char *argv[])
textdomain(PACKAGE);
maxcpus = get_max_number_of_cpus();
- if (maxcpus <= 0)
+ if ((int) maxcpus <= 0)
errx(EXIT_FAILURE, _("cannot determine NR_CPUS; aborting"));
if (path_exist(_PATH_SYS_CPU_ONLINE))
onlinecpus = path_cpulist(maxcpus, _PATH_SYS_CPU_ONLINE);