changed arrangement of SIGINT and TERM so they work on MSWin32
[spider.git] / perl / cluster.pl
index 5c53e113d0e8dbc02907e6e055f334d6df03bc4b..d3feaa39c813c7936d72fca0abd4a1cdac6ee12a 100755 (executable)
@@ -206,8 +206,10 @@ sub cease
 {
        my $dxchan;
 
-       $SIG{'TERM'} = 'IGNORE';
-       $SIG{'INT'} = 'IGNORE';
+       unless ($is_win) {
+               $SIG{'TERM'} = 'IGNORE';
+               $SIG{'INT'} = 'IGNORE';
+       }
        
        DXUser::sync;
 
@@ -386,11 +388,11 @@ AGWrestart();
 dbg('err', "load badwords: " . (BadWords::load or "Ok"));
 
 # prime some signals
+unless ($DB::VERSION) {
+       $SIG{INT} = $SIG{TERM} = sub { $decease = 1 };
+}
+
 unless ($is_win) {
-       unless ($DB::VERSION) {
-               $SIG{INT} = \&cease;
-               $SIG{TERM} = \&cease;
-       }
        $SIG{HUP} = 'IGNORE';
        $SIG{CHLD} = sub { $zombies++ };