diff options
-rw-r--r-- | selftest/target/Samba.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm index ab3851f67e..b0817fd3d2 100644 --- a/selftest/target/Samba.pm +++ b/selftest/target/Samba.pm @@ -188,7 +188,12 @@ sub get_interface($) sub cleanup_child($$) { my ($pid, $name) = @_; - my $childpid = waitpid($pid, WNOHANG); + my $childpid = -1; + + if (defined($pid)) { + $childpid = waitpid($pid, WNOHANG); + } + if ($childpid == 0) { } elsif ($childpid < 0) { printf STDERR "%s child process %d isn't here any more\n", |