selftest: Fix waitpid termination test
authorAndrew Bartlett <abartlet@samba.org>
Sun, 4 Mar 2012 07:10:35 +0000 (18:10 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 4 Mar 2012 09:14:34 +0000 (10:14 +0100)
selftest/target/Samba3.pm

index c9ad7d31fef743d266995ac3a15efc8f6cfd5c61..a5ae8a1bb08e0e51123180b6c36f7e30833ef6f1 100755 (executable)
@@ -57,7 +57,7 @@ sub teardown_env($$)
            # This should give it time to write out the gcov data
            sleep(1);
            $count++;
-           last if $childpid == 0 or $count > 20;
+           last if $childpid == -1 or $count > 20;
        }
 
        if ($count <= 20) {
@@ -74,7 +74,7 @@ sub teardown_env($$)
            my $childpid = waitpid(-1, WNOHANG);
            sleep(1);
            $count++;
-           last if $childpid == 0 or $count > 20;
+           last if $childpid == -1 or $count > 20;
        }
        
        if ($count <= 10) {