On my system this gets evaluated to 0 so in the end we detect samba to
be running cause $childpid is set to 0.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10793
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Sep 4 17:09:17 CEST 2014 on sn-devel-104
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",