about summary refs log tree commit homepage
path: root/lib/PublicInbox/Spamcheck/Spamc.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-26 07:44:39 +0000
committerEric Wong <e@80x24.org>2023-09-26 21:02:46 +0000
commit344897c0b27e061e41f2660f3c7a3de9a7b78452 (patch)
tree15de9bdd980a648045018e694e21512314471723 /lib/PublicInbox/Spamcheck/Spamc.pm
parent0bb5d85daf061ca1a9ab886fa3c4129eb9e18651 (diff)
downloadpublic-inbox-344897c0b27e061e41f2660f3c7a3de9a7b78452.tar.gz
We lose error information on CORE::close call, but the
underlying close(2) syscall won't EIO nor ENOSPC on a read-only
side of a pipe.  Perl is already shielding us from EINTR and
EBADF would be a bug in Perl itself.
Diffstat (limited to 'lib/PublicInbox/Spamcheck/Spamc.pm')
-rw-r--r--lib/PublicInbox/Spamcheck/Spamc.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/Spamcheck/Spamc.pm b/lib/PublicInbox/Spamcheck/Spamc.pm
index 2f821532..67278917 100644
--- a/lib/PublicInbox/Spamcheck/Spamc.pm
+++ b/lib/PublicInbox/Spamcheck/Spamc.pm
@@ -21,14 +21,13 @@ sub spamcheck {
         my ($self, $msg, $out) = @_;
 
         my $rdr = { 0 => _msg_to_fh($self, $msg) };
-        my ($fh, $pid) = popen_rd($self->{checkcmd}, undef, $rdr);
+        my $fh = popen_rd($self->{checkcmd}, undef, $rdr);
         unless (ref $out) {
                 my $buf = '';
                 $out = \$buf;
         }
         $$out = do { local $/; <$fh> };
-        close $fh or die "close failed: $!";
-        waitpid($pid, 0);
+        close $fh; # PublicInbox::ProcessPipe::CLOSE
         ($? || $$out eq '') ? 0 : 1;
 }