From bebf70667dcba71030737ade35a0aa7063640414 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 13 Jan 2006 12:16:16 +0000 Subject: Andrew Benham fixed a race condition in the test suite that could cause the test script to kill all processes in the current process group! --- tests/runtests.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/runtests.pl') diff --git a/tests/runtests.pl b/tests/runtests.pl index e4a7b1071..a982dc712 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -249,9 +249,10 @@ sub startnew { open(PID, "<$pidfile"); $pid2 = 0 + ; close(PID); - if(kill(0, $pid2)) { - # make sure this pid is alive, as otherwise it is just likely - # to be the _previous_ pidfile or similar! + if($pid2 && kill(0, $pid2)) { + # if $pid2 is valid, then make sure this pid is alive, as + # otherwise it is just likely to be the _previous_ pidfile or + # similar! last; } } -- cgit v1.2.3