Skip to content

Commit c240d36

Browse files
committed
test.pl: Don't assume existing watchdog uses alarm()
The fallback method of setting a watchdog timer is to use alarm(). Prior to this commit, the code presumed that if it wasn't one of the other possibilities, it must be this one. This is a valid assumption currently, but future commits will change that. Prepare for them with this commit.
1 parent abdf59c commit c240d36

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

t/test.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1838,6 +1838,7 @@ sub warning_like {
18381838
{ # Closure
18391839
my $watchdog_process;
18401840
my $watchdog_thread;
1841+
my $watchdog_alarm;
18411842

18421843
sub watchdog ($;$)
18431844
{
@@ -1854,8 +1855,9 @@ ($;$)
18541855
kill('KILL', $watchdog_process);
18551856
undef $watchdog_process;
18561857
}
1857-
else {
1858+
elsif ($watchdog_alarm) {
18581859
alarm(0);
1860+
undef $watchdog_alarm;
18591861
}
18601862

18611863
return;
@@ -2060,6 +2062,7 @@ ($;$)
20602062
my $sig = ($is_vms) ? 'TERM' : 'KILL';
20612063
kill($sig, $pid_to_kill);
20622064
};
2065+
$watchdog_alarm = 1;
20632066
}
20642067
}
20652068
} # End closure

0 commit comments

Comments
 (0)