use PublicInbox::DS;
use PublicInbox::Spawn qw(which popen_rd);
use PublicInbox::InboxWritable qw(eml_from_path);
+use PublicInbox::AutoReap;
# JMAP RFC 8621 4.1.1
# https://www.iana.org/assignments/imap-jmap-keywords/imap-jmap-keywords.xhtml
push @$curl, '-s', @$curl_opt;
my $cmd = $curl->for_uri($lei, $uri);
$lei->qerr("# $cmd");
- my $rdr = { 2 => $lei->{2}, pgid => 0 };
- my ($fh, $pid) = popen_rd($cmd, undef, $rdr);
+ my ($fh, $pid) = popen_rd($cmd, undef, { 2 => $lei->{2} });
+ my $ar = PublicInbox::AutoReap->new($pid);
grep(/\A--compressed\z/, @$curl) or
$fh = IO::Uncompress::Gunzip->new($fh, MultiStream => 1);
eval { $self->input_fh('mboxrd', $fh, $url, @args) };
my $err = $@;
- waitpid($pid, 0);
+ $ar->join;
$? || $err and
$lei->child_error($?, "@$cmd failed".$err ? " $err" : '');
}
sub input_only_net_merge_all_done {
my ($self) = @_;
$self->wq_io_do('process_inputs');
- $self->wq_close(1);
+ $self->wq_close;
}
# like Getopt::Long, but for +kw:FOO and -kw:FOO to prepare