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!
This commit is contained in:
Daniel Stenberg 2006-01-13 12:16:16 +00:00
parent d9bd5de0b1
commit bebf70667d
3 changed files with 10 additions and 4 deletions

View file

@ -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;
}
}