summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Walde <walde.christian@gmail.com>2020-09-16 21:06:48 +0200
committerKarl Williamson <khw@cpan.org>2020-09-16 13:10:57 -0600
commitbbd21b340219e33e5603768033f78c673149bc9b (patch)
tree564e49c0cdc24bf48dfa060732376768ad9f208c
parentc3788eea4d958f1c7797de83aa454b51176cc9ca (diff)
downloadperl-bbd21b340219e33e5603768033f78c673149bc9b.tar.gz
prevent a spurious error output from test.pl when killing a cygwin process
Under Cygwin a process can sometimes take a little while to spool down after being killed. There already is code to wait a second and retry. However if the process has already disappeared in the wait second, then the retry is engaged anyhow and will then complain it can't find the process. This change makes it so test.pl only truly attempts to kill a cygwin process if it actually is still around. This resolves the secondary bug in #18129.
-rw-r--r--t/test.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/test.pl b/t/test.pl
index f78df4ec73..bf3ccf205f 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -1716,7 +1716,7 @@ sub watchdog ($;$)
if ($is_cygwin) {
# sometimes the above isn't enough on cygwin
sleep 1; # wait a little, it might have worked after all
- system("/bin/kill -f $pid_to_kill");
+ system("/bin/kill -f $pid_to_kill") if kill(0, $pid_to_kill);
}
}