Skip to content

Commit abdf59c

Browse files
committed
test.pl: Change variable name
The next commit changes things, so that some people may find that after that, the current name would be misleading or confusing.
1 parent e19d1bb commit abdf59c

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

t/test.pl

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ sub warning_like {
18361836
# NOTE: If the test file uses 'threads', then call the watchdog() function
18371837
# _AFTER_ the 'threads' module is loaded.
18381838
{ # Closure
1839-
my $watchdog;
1839+
my $watchdog_process;
18401840
my $watchdog_thread;
18411841

18421842
sub watchdog ($;$)
@@ -1850,9 +1850,9 @@ ($;$)
18501850
$watchdog_thread->kill('KILL');
18511851
undef $watchdog_thread;
18521852
}
1853-
elsif ($watchdog) {
1854-
kill('KILL', $watchdog);
1855-
undef $watchdog;
1853+
elsif ($watchdog_process) {
1854+
kill('KILL', $watchdog_process);
1855+
undef $watchdog_process;
18561856
}
18571857
else {
18581858
alarm(0);
@@ -1862,7 +1862,7 @@ ($;$)
18621862
}
18631863

18641864
# Make sure these aren't defined.
1865-
undef $watchdog;
1865+
undef $watchdog_process;
18661866
undef $watchdog_thread;
18671867

18681868
my $method = shift || "";
@@ -1913,7 +1913,7 @@ ($;$)
19131913
return if ($pid_to_kill <= 0);
19141914

19151915
# Launch watchdog process
1916-
undef $watchdog;
1916+
undef $watchdog_process;
19171917
eval {
19181918
local $SIG{'__WARN__'} = sub {
19191919
_diag("Watchdog warning: $_[0]");
@@ -1940,37 +1940,38 @@ ($;$)
19401940
if ($runperl =~ m/\s/) {
19411941
$runperl = qq{"$runperl"};
19421942
}
1943-
$watchdog = system({ $runperl } 1, $runperl, '-e', $prog);
1943+
$watchdog_process =
1944+
system({ $runperl } 1, $runperl, '-e', $prog);
19441945
}
19451946
else {
19461947
my $cmd = _create_runperl(prog => $prog);
1947-
$watchdog = system(1, $cmd);
1948+
$watchdog_process = system(1, $cmd);
19481949
}
19491950
};
19501951

1951-
if ($@ || $watchdog <= 0) {
1952+
if ($@ || $watchdog_process <= 0) {
19521953
$@ = "\n$@" if $@;
19531954
_diag("Failed to start watchdog$@\nTrying alternate method");
1954-
undef($watchdog);
1955+
undef($watchdog_process);
19551956
goto WATCHDOG_VIA_ALARM;
19561957
}
19571958

19581959
# Add END block to parent to terminate and clean up watchdog
19591960
# process
19601961
eval("END { local \$! = 0; local \$? = 0;
1961-
wait() if kill('KILL', $watchdog); };");
1962+
wait() if kill('KILL', $watchdog_process); };");
19621963
return;
19631964
}
19641965

19651966
# Try using fork() to generate a watchdog process
1966-
undef $watchdog;
1967-
eval { $watchdog = fork() };
1968-
if (defined($watchdog)) {
1969-
if ($watchdog) { # Parent process
1967+
undef $watchdog_process;
1968+
eval { $watchdog_process = fork() };
1969+
if (defined($watchdog_process)) {
1970+
if ($watchdog_process) { # Parent process
19701971
# Add END block to parent to terminate and clean up watchdog
19711972
# process
19721973
eval "END { local \$! = 0; local \$? = 0;
1973-
wait() if kill('KILL', $watchdog); };";
1974+
wait() if kill('KILL', $watchdog_process); };";
19741975
return;
19751976
}
19761977

0 commit comments

Comments
 (0)