diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-01-13 12:16:16 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-01-13 12:16:16 +0000 |
commit | bebf70667dcba71030737ade35a0aa7063640414 (patch) | |
tree | 50a6000b3e084039ae94706b1f984103c5cd545e /tests | |
parent | d9bd5de0b12b00db813dcfaec2f8f12636b721a1 (diff) |
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!
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runtests.pl | 7 |
1 files changed, 4 insertions, 3 deletions
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 + <PID>; 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; } } |