Changeset 2605

Show
Ignore:
Timestamp:
06/22/04 20:51:08 (9 years ago)
Author:
khali
Message:

Make sure restorefans is called only once. Suggested by James

Olin Oden.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/pwm/fancontrol.pl

    r2602 r2605  
    6666our @afcminstart; 
    6767our @afcminstop; 
     68our $fanrestored; 
    6869 
    6970sub loadconfig($); 
     
    299300sub restorefans() 
    300301{ 
    301    $SIG{TERM} = 'IGNORE'; 
    302    $SIG{HUP}  = 'IGNORE'; 
    303    $SIG{INT}  = 'IGNORE'; 
    304    $SIG{QUIT} = 'IGNORE'; 
    305  
    306    print("Aborting, restoring fans...\n"); 
    307    my $fcvcount = 0; 
    308  
    309    while ( $fcvcount < $#afcpwm+1) 
    310      { 
    311        my $pwmo = $afcpwm[$fcvcount]; 
    312        &pwmdisable($afcpwm[$fcvcount]); 
    313        $fcvcount++; 
    314      } 
    315    print("Verify fans have returned to full speed\n"); 
    316    exit(0); 
     302   unless ($fanrestored) 
     303     { 
     304       $SIG{TERM} = 'IGNORE'; 
     305       $SIG{HUP}  = 'IGNORE'; 
     306       $SIG{INT}  = 'IGNORE'; 
     307       $SIG{QUIT} = 'IGNORE'; 
     308 
     309       print("Aborting, restoring fans...\n"); 
     310       my $fcvcount = 0; 
     311 
     312       while ($fcvcount < $#afcpwm+1) 
     313         { 
     314           my $pwmo = $afcpwm[$fcvcount]; 
     315           &pwmdisable($afcpwm[$fcvcount]); 
     316           $fcvcount++; 
     317         } 
     318       print("Verify fans have returned to full speed\n"); 
     319       $fanrestored = 1; 
     320       exit(0); 
     321     } 
    317322} 
    318323