Else more than one process can kill our worker!
close($self->{child}) if defined($self->{child});
+ # only kill if we created the process
+ return if $self->{pid} != $$;
+
kill(9, $self->{cpid});
waitpid($self->{cpid}, 0);
};
$expect_tag = '>' if !$expect_tag;
+ die "detected forked connection" if $self->{pid} != $$;
+
my ($restag, $raw);
my $code = sub {
&$writedata($self->{child}, $cmd, $data) if $expect_tag ne 'S';
my $timeout = delete $params{timeout} || $rados_default_timeout;
$self->{timeout} = $timeout;
+ $self->{pid} = $$;
if ($cpid) { # parent
close $parent;