Signed-off-by: Karel Zak <kzak@redhat.com>
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);
else if (mod->system == SYSTEM_LIVE)
/* the root is '/' so we are working with data from the current kernel */
maxcpus = get_max_number_of_cpus();
- else
- /* we are reading some /sys snapshot instead of the real /sys,
- * let's use any crazy number... */
+
+ if (maxcpus <= 0)
+ /* error or we are reading some /sys snapshot instead of the
+ * real /sys, let's use any crazy number... */
maxcpus = desc->ncpus > 2048 ? desc->ncpus : 2048;
/* get mask for online CPUs */