From 6ef95354dbe642232b58ceeaf2283870aef34b2f Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 31 Dec 2012 02:12:53 +0100 Subject: [PATCH] bin/*.pl: Add missing die to close. --- bin/battery.pl | 2 +- bin/temperature.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/battery.pl b/bin/battery.pl index 41956ac..9a6a976 100755 --- a/bin/battery.pl +++ b/bin/battery.pl @@ -37,7 +37,7 @@ while (<$file>) { /^POWER_SUPPLY_([A-Z_]+)=(.+)$/; $battery{$1} = $2; } -close $file; +close $file or die $!; my $charge = int($battery{CHARGE_NOW} / $battery{CHARGE_FULL} * 100); diff --git a/bin/temperature.pl b/bin/temperature.pl index 9ee40cd..0063bf4 100755 --- a/bin/temperature.pl +++ b/bin/temperature.pl @@ -37,10 +37,10 @@ my $critical; my $file; open $file, '<', $temperature_path or die $!; $temperature = <$file>; -close $file; +close $file or die $!; open $file, '<', $critical_path or die $!; $critical = <$file>; -close $file; +close $file or die $!; my $value = int($temperature / 1000); my $risk = ($critical - $temperature)/$critical; -- 2.45.2