1 # Copyright (C) 2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # forwards stderr from lei/store process to any lei clients using
6 package PublicInbox::LeiStoreErr;
9 use parent qw(PublicInbox::DS);
10 use PublicInbox::Syscall qw(EPOLLIN EPOLLONESHOT);
13 my ($cls, $rd, $lei) = @_;
14 my $self = bless { sock => $rd, store_path => $lei->store_path }, $cls;
15 $self->SUPER::new($rd, EPOLLIN | EPOLLONESHOT);
20 $self->do_read(\(my $rbuf), 4096) or return;
22 for my $lei (values %PublicInbox::DS::DescriptorMap) {
23 $cb = $lei->can('store_path') // next;
24 next if $cb->($lei) ne $self->{store_path};
25 my $err = $lei->{2} // next;