2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

fix: numeric check

git-svn-id: https://svn.fhem.de/fhem/trunk@6713 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hexenmeister 2014-10-08 19:59:52 +00:00
parent 937b9a0c14
commit 19f1b9249c

View File

@ -30,7 +30,7 @@ package main;
use strict;
use warnings;
my $VERSION = "1.9.2";
my $VERSION = "1.9.3";
use constant {
PERL_VERSION => "perl_version",
@ -928,11 +928,15 @@ SYSMON_getCPUCoreNum($)
return $sys_cpu_core_num if $sys_cpu_core_num;
my $str = SYSMON_execute($hash, "cat /sys/devices/system/cpu/kernel_max");
if(int($str)!=0) {
$sys_cpu_core_num = int($str)+1;
return $sys_cpu_core_num;
}
if(defined($str)) {
if($str ne "") {
if(int($str)!=0) {
$sys_cpu_core_num = int($str)+1;
return $sys_cpu_core_num;
}
}
}
return 1; # Default / unbekannt
}