about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-05-21 10:28:26 +0000
committerEric Wong <e@80x24.org>2021-05-23 01:33:02 +0000
commit3f4b1cb5884531acae332cddba0ed3d647424567 (patch)
tree92b579971389d21a946c909e043ee3a81daa5e74 /lib
parente901a56b3b30b22f16bc9c6460150b2b402b4ee7 (diff)
downloadpublic-inbox-3f4b1cb5884531acae332cddba0ed3d647424567.tar.gz
lei already uses PktOp and SOCK_SEQPACKET throughout; whereas
EOFpipe had one single use in lei.  Since PktOp is a strict
superset of EOFpipe functionality, we may be able to get rid of
EOFpipe entirely.

However, lei is considered a portability canary and I'm not sure
if the stable public-inbox-* code can drop EOFpipe just yet.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/LEI.pm9
-rw-r--r--lib/PublicInbox/LeiOverview.pm2
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 98e79a76..d7768426 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -1151,7 +1151,7 @@ sub lazy_start {
 (Socket::MsgHdr || Inline::C) missing/unconfigured (narg=$narg);
 
         require PublicInbox::Listener;
-        require PublicInbox::EOFpipe;
+        require PublicInbox::PktOp;
         (-p STDOUT) or die "E: stdout must be a pipe\n";
         open(STDIN, '+>>', $errors_log) or die "open($errors_log): $!";
         STDIN->autoflush(1);
@@ -1165,13 +1165,12 @@ sub lazy_start {
         my $exit_code;
         my $pil = PublicInbox::Listener->new($listener, \&accept_dispatch);
         local $quit = do {
-                pipe(my ($eof_r, $eof_w)) or die "pipe: $!";
-                PublicInbox::EOFpipe->new($eof_r, \&noop, undef);
+                my (undef, $eof_p) = PublicInbox::PktOp->pair;
                 sub {
                         $exit_code //= shift;
                         my $lis = $pil or exit($exit_code);
-                        # closing eof_w triggers \&noop wakeup
-                        $listener = $eof_w = $pil = $path = undef;
+                        # closing eof_p triggers \&noop wakeup
+                        $listener = $eof_p = $pil = $path = undef;
                         $lis->close; # DS::close
                         PublicInbox::DS->SetLoopTimeout(1000);
                 };
diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm
index bfb8b143..28891460 100644
--- a/lib/PublicInbox/LeiOverview.pm
+++ b/lib/PublicInbox/LeiOverview.pm
@@ -119,7 +119,7 @@ sub ovv_begin {
         } # TODO HTML/Atom/...
 }
 
-# called once by parent (via PublicInbox::EOFpipe)
+# called once by parent (via PublicInbox::PktOp  '' => query_done)
 sub ovv_end {
         my ($self, $lei) = @_;
         if ($self->{fmt} eq 'json') {