mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-10 16:30:50 +00:00
Make sure restorefans is called only once. Suggested by James
Olin Oden. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2605 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
e7e4c799da
commit
35f4d9595c
1 file changed
+19
-14
+19
-14
@@ -65,6 +65,7 @@ our @afcmaxtemp;
|
||||
our @afcmintemp;
|
||||
our @afcminstart;
|
||||
our @afcminstop;
|
||||
our $fanrestored;
|
||||
|
||||
sub loadconfig($);
|
||||
sub pwmdisable($);
|
||||
@@ -298,22 +299,26 @@ sub pwmenable($)
|
||||
################################################################
|
||||
sub restorefans()
|
||||
{
|
||||
$SIG{TERM} = 'IGNORE';
|
||||
$SIG{HUP} = 'IGNORE';
|
||||
$SIG{INT} = 'IGNORE';
|
||||
$SIG{QUIT} = 'IGNORE';
|
||||
|
||||
print("Aborting, restoring fans...\n");
|
||||
my $fcvcount = 0;
|
||||
|
||||
while ( $fcvcount < $#afcpwm+1)
|
||||
unless ($fanrestored)
|
||||
{
|
||||
my $pwmo = $afcpwm[$fcvcount];
|
||||
&pwmdisable($afcpwm[$fcvcount]);
|
||||
$fcvcount++;
|
||||
$SIG{TERM} = 'IGNORE';
|
||||
$SIG{HUP} = 'IGNORE';
|
||||
$SIG{INT} = 'IGNORE';
|
||||
$SIG{QUIT} = 'IGNORE';
|
||||
|
||||
print("Aborting, restoring fans...\n");
|
||||
my $fcvcount = 0;
|
||||
|
||||
while ($fcvcount < $#afcpwm+1)
|
||||
{
|
||||
my $pwmo = $afcpwm[$fcvcount];
|
||||
&pwmdisable($afcpwm[$fcvcount]);
|
||||
$fcvcount++;
|
||||
}
|
||||
print("Verify fans have returned to full speed\n");
|
||||
$fanrestored = 1;
|
||||
exit(0);
|
||||
}
|
||||
print("Verify fans have returned to full speed\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user