We only care about error checking when stdout is an mbox output
pointed to a pathname. This is noticeable with `lei up' with
multiple non-mbox* destinations. We'll also ensure throwing
exceptions to trigger lei->x_it from lei->do_env results in the
epoll/kqueue watch being discarded, otherwise commands may never
terminate (leading to stuck tests)
} elsif ($quit == \&CORE::exit) { # an admin (one-shot) command
exit($code >> 8);
} # else ignore if client disconnected
+ $self->dclose if $$ == $daemon_pid;
}
sub err ($;@) {
sub finish_output {
my ($self, $lei) = @_;
my $out = delete $lei->{1} // die 'BUG: no lei->{1}';
- my $old = delete $lei->{old_1};
- $lei->{1} = $old if $old;
+ my $old = delete $lei->{old_1} or return; # path only
+ $lei->{1} = $old;
return if $out->close; # reaps gzip|pigz|xz|bzip2
my $msg = "E: Error closing $lei->{ovv}->{dst}";
$? ? $lei->child_error($?) : ($msg .= " ($!)");
is(scalar(@new), 2, 'got new message');
is_xdeeply([grep { $_ eq $orig[0] } @new], \@orig,
'original message preserved on up w/ threads');
+ lei_ok 'up', "$home/md", $d, \'multiple maildir up';
+ unlike $lei_err, qr! line \d+!s, 'no warnings';
});
done_testing;