Skip to content

Commit 26d5dba

Browse files
committed
test.pl: Try alarm if can't start watchdog on Win/VMS
Prior to this commit, the code gave up immediately if it tried unsuccessfully to use a watchdog thread. But the alarm method is still available. Drop down to try it.
1 parent 436f14c commit 26d5dba

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

t/test.pl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,18 +1947,19 @@ ($;$)
19471947
$watchdog = system(1, $cmd);
19481948
}
19491949
};
1950-
if ($@ || ($watchdog <= 0)) {
1951-
_diag('Failed to start watchdog');
1952-
_diag($@) if $@;
1953-
undef($watchdog);
1954-
return;
1955-
}
1950+
1951+
if (! $@ && $watchdog > 0) {
19561952

19571953
# Add END block to parent to terminate and clean up watchdog
19581954
# process
19591955
eval("END { local \$! = 0; local \$? = 0;
19601956
wait() if kill('KILL', $watchdog); };");
19611957
return;
1958+
}
1959+
1960+
$@ = "\n$@" if $@;
1961+
_diag("Failed to start watchdog$@\nTrying alternate method");
1962+
goto WATCHDOG_VIA_ALARM;
19621963
}
19631964

19641965
# Try using fork() to generate a watchdog process

0 commit comments

Comments
 (0)