From 059f92ef0d66677cce0b0d011748f7fcc1697a51 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 3 Sep 2021 08:54:24 +0000 Subject: lei up --all: avoid double-close on shared STDOUT This is merely to avoid perl setting errors internally which were not user visible. The double-close wasn't a problem in practice since we open a new file hanlde for the mbox or mbox.gz anyways, so the new t/lei-up.t test case shows no regressions nor fixes. --- lib/PublicInbox/LeiUp.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/PublicInbox/LeiUp.pm') diff --git a/lib/PublicInbox/LeiUp.pm b/lib/PublicInbox/LeiUp.pm index e1da64aa..a39d6047 100644 --- a/lib/PublicInbox/LeiUp.pm +++ b/lib/PublicInbox/LeiUp.pm @@ -54,6 +54,10 @@ sub up1_redispatch { $l->{opt} = { %{$l->{opt}} }; delete $l->{sock}; $l->{''} = $op_p; # daemon only + + # make close($l->{1}) happy in lei->dclose + open my $fh, '>&', $l->{1} or return $l->child_error(0, "dup: $!"); + $l->{1} = $fh; eval { $l->qerr("# updating $out"); up1($l, $out); -- cgit v1.2.3-24-ge0c7