1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

Fix issue with $uptime being undefined

Fix issue with $uptime being undefined.
On my setup perl requires a variable to assign the return value of the split operation. Without this the value of $uptime ends up being undefined.
This commit is contained in:
Stephan 2014-07-16 23:52:03 +02:00
parent c43dc4b9a2
commit fa5458e1aa

View file

@ -208,8 +208,8 @@ sub uptime {
my $puptime = "/proc/uptime"; my $puptime = "/proc/uptime";
open( TIME, "<", $puptime ) || die "Unable to read $puptime: $!"; open( TIME, "<", $puptime ) || die "Unable to read $puptime: $!";
while (<TIME>) { while (<TIME>) {
split; my @arr = split;
$uptime = @_[0]; $uptime = $arr[0];
} }
close(TIME); close(TIME);
chomp $uptime; chomp $uptime;