mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Utils: fixed crash in getCoreCount(), closes #2600
this should just default to 2 instead of shitting its pants.
This commit is contained in:
parent
75df6973df
commit
1455c38dbe
@ -313,8 +313,8 @@ class Utils{
|
||||
++$processors;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(preg_match("/^([0-9]+)\\-([0-9]+)$/", trim(@file_get_contents("/sys/devices/system/cpu/present")), $matches) > 0){
|
||||
}elseif(is_readable("/sys/devices/system/cpu/present")){
|
||||
if(preg_match("/^([0-9]+)\\-([0-9]+)$/", trim(file_get_contents("/sys/devices/system/cpu/present")), $matches) > 0){
|
||||
$processors = (int) ($matches[2] - $matches[1]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user