about summary refs log tree commit homepage
path: root/lib/PublicInbox/LEI.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-15 09:21:42 +0000
committerEric Wong <e@80x24.org>2023-11-16 10:56:51 +0000
commit95de492d3ca723fe81ec3bd23d89b643ce98823e (patch)
tree6adfe7b61509e1e9d49920e723537c21d63c25e6 /lib/PublicInbox/LEI.pm
parentc137c32f4f4c5266f71f6606e58f3497e94af8b4 (diff)
downloadpublic-inbox-95de492d3ca723fe81ec3bd23d89b643ce98823e.tar.gz
This is needed to support forking from already-forked lei workers
and $lei->{2} is already STDERR.

Fixes: e015c3742f91 (lei: use autodie where appropriate, 2023-10-17)
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r--lib/PublicInbox/LEI.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 460aed40..8d235b37 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -581,7 +581,7 @@ sub _lei_atfork_child {
                 close($_) for (grep(defined, delete @$self{qw(0 1 2 sock)}));
                 delete $cfg->{-lei_store};
         } else { # worker, Net::NNTP (Net::Cmd) uses STDERR directly
-                open STDERR, '+>&', $self->{2};
+                open STDERR, '+>&='.fileno($self->{2}); # idempotent w/ fileno
                 STDERR->autoflush(1);
                 $self->{2} = \*STDERR;
                 POSIX::setpgid(0, $$) // die "setpgid(0, $$): $!";