fixed more messages of use of uninitialized values at fs.pm in lines 765 and 766. This mainly happens in OpenVZ VPS where '/proc/diskstats' file does not exist.

This commit is contained in:
Jordi Sanfeliu 2014-09-01 18:57:15 +02:00
parent 2fe19df4ed
commit 55e6915423
2 changed files with 12 additions and 8 deletions

View File

@ -1,6 +1,9 @@
3.N.N - DD-MMM-2014
====================
- Fixed some bugs in the new Makefile. [#63]
- Fixed more messages of use of uninitialized values at fs.pm in lines 765 and
766. This mainly happens in OpenVZ VPS where '/proc/diskstats' file does not
exist.
3.6.0 - 20-Aug-2014

View File

@ -713,14 +713,15 @@ sub fs_update {
if($d) {
if($config->{os} eq "Linux") {
if($config->{kernel} gt "2.4") {
open(IN, "/proc/diskstats");
while(<IN>) {
if(/ $d /) {
@tmp = split(' ', $_);
last;
if(open(IN, "/proc/diskstat")) {
while(<IN>) {
if(/ $d /) {
@tmp = split(' ', $_);
last;
}
}
close(IN);
}
close(IN);
(undef, undef, undef, $read_cnt, undef, undef, $read_sec, $write_cnt, undef, undef, $write_sec) = @tmp;
} else {
my $io;
@ -761,8 +762,8 @@ sub fs_update {
}
}
$ioa = $read_cnt + $write_cnt;
$tim = $read_sec + $write_sec;
$ioa = ($read_cnt || 0) + ($write_cnt || 0);
$tim = ($read_sec || 0) + ($write_sec || 0);
$str = $e . "_ioa" . $n;
$val = $ioa;