]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: oneshot: use client $io[2] for placeholder
authorEric Wong <e@80x24.org>
Thu, 21 Jan 2021 19:46:19 +0000 (19:46 +0000)
committerEric Wong <e@80x24.org>
Fri, 22 Jan 2021 20:18:01 +0000 (16:18 -0400)
STDERR may actually get closed in ->ipc_atfork_child in
oneshot mode, so ensure we pass in a valid file handle
to avoid warnings ->wq_do.

lib/PublicInbox/LEI.pm

index 2cb2bf406c433f66e72c6c9e3499b0cc11fb6244..11ea385f2a1976619a873f585a72aed0e1dfc06d 100644 (file)
@@ -334,7 +334,7 @@ sub atfork_parent_wq {
        $self->{env} = $env;
        delete @$ret{qw(-lei_store cfg pgr lxs)}; # keep l2m
        my @io = delete @$ret{0..2};
-       $io[3] = delete($ret->{sock}) // *STDERR{GLOB};
+       $io[3] = delete($ret->{sock}) // $io[2];
        my $l2m = $ret->{l2m};
        if ($l2m && $l2m != $wq) { # $wq == lxs
                $io[4] = $l2m->{-wq_s1} if $l2m->{-wq_s1};