@@ -1836,7 +1836,7 @@ sub warning_like {
1836
1836
# NOTE: If the test file uses 'threads', then call the watchdog() function
1837
1837
# _AFTER_ the 'threads' module is loaded.
1838
1838
{ # Closure
1839
- my $watchdog ;
1839
+ my $watchdog_process ;
1840
1840
my $watchdog_thread ;
1841
1841
1842
1842
sub watchdog ($;$)
@@ -1850,9 +1850,9 @@ ($;$)
1850
1850
$watchdog_thread -> kill (' KILL' );
1851
1851
undef $watchdog_thread ;
1852
1852
}
1853
- elsif ($watchdog ) {
1854
- kill (' KILL' , $watchdog );
1855
- undef $watchdog ;
1853
+ elsif ($watchdog_process ) {
1854
+ kill (' KILL' , $watchdog_process );
1855
+ undef $watchdog_process ;
1856
1856
}
1857
1857
else {
1858
1858
alarm(0);
@@ -1862,7 +1862,7 @@ ($;$)
1862
1862
}
1863
1863
1864
1864
# Make sure these aren't defined.
1865
- undef $watchdog ;
1865
+ undef $watchdog_process ;
1866
1866
undef $watchdog_thread ;
1867
1867
1868
1868
my $method = shift || " " ;
@@ -1913,7 +1913,7 @@ ($;$)
1913
1913
return if ($pid_to_kill <= 0);
1914
1914
1915
1915
# Launch watchdog process
1916
- undef $watchdog ;
1916
+ undef $watchdog_process ;
1917
1917
eval {
1918
1918
local $SIG {' __WARN__' } = sub {
1919
1919
_diag(" Watchdog warning: $_ [0]" );
@@ -1940,37 +1940,38 @@ ($;$)
1940
1940
if ($runperl =~ m /\s / ) {
1941
1941
$runperl = qq{ "$runperl "} ;
1942
1942
}
1943
- $watchdog = system ({ $runperl } 1, $runperl , ' -e' , $prog );
1943
+ $watchdog_process =
1944
+ system ({ $runperl } 1, $runperl , ' -e' , $prog );
1944
1945
}
1945
1946
else {
1946
1947
my $cmd = _create_runperl(prog => $prog );
1947
- $watchdog = system (1, $cmd );
1948
+ $watchdog_process = system (1, $cmd );
1948
1949
}
1949
1950
};
1950
1951
1951
- if ($@ || $watchdog <= 0) {
1952
+ if ($@ || $watchdog_process <= 0) {
1952
1953
$@ = " \n $@ " if $@ ;
1953
1954
_diag(" Failed to start watchdog$@ \n Trying alternate method" );
1954
- undef ($watchdog );
1955
+ undef ($watchdog_process );
1955
1956
goto WATCHDOG_VIA_ALARM;
1956
1957
}
1957
1958
1958
1959
# Add END block to parent to terminate and clean up watchdog
1959
1960
# process
1960
1961
eval (" END { local \$ ! = 0; local \$ ? = 0;
1961
- wait() if kill('KILL', $watchdog ); };" );
1962
+ wait() if kill('KILL', $watchdog_process ); };" );
1962
1963
return ;
1963
1964
}
1964
1965
1965
1966
# 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
1970
1971
# Add END block to parent to terminate and clean up watchdog
1971
1972
# process
1972
1973
eval " END { local \$ ! = 0; local \$ ? = 0;
1973
- wait() if kill('KILL', $watchdog ); };" ;
1974
+ wait() if kill('KILL', $watchdog_process ); };" ;
1974
1975
return ;
1975
1976
}
1976
1977
0 commit comments