my $pid = fork;
defined $pid or die "fork failed: $!\n";
if ($pid == 0) {
- foreach my $other (@{$v2writable->{idx_parts}}) {
- my $other_w = $other->{w} or next;
- close $other_w or die "close other failed: $!\n";
- }
+ $v2writable->atfork_child;
$v2writable = undef;
close $w;
$w->flush or die "failed to flush: $!\n";
}
+sub atfork_child {
+ close $_[0]->{w} or die "failed to close write pipe: $!\n";
+}
+
1;