about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox/Spamcheck/Spamc.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/PublicInbox/Spamcheck/Spamc.pm b/lib/PublicInbox/Spamcheck/Spamc.pm
index 30eec95c..ba8e44a4 100644
--- a/lib/PublicInbox/Spamcheck/Spamc.pm
+++ b/lib/PublicInbox/Spamcheck/Spamc.pm
@@ -29,10 +29,14 @@ sub spamcheck {
                 my $buf = '';
                 $out = \$buf;
         }
+again:
         do {
                 $r = sysread($fh, $$out, 65536, length($$out));
         } while (defined($r) && $r != 0);
-        defined $r or die "read failed: $!";
+        unless (defined $r) {
+                goto again if $!{EINTR};
+                die "read failed: $!";
+        }
         close $fh or die "close failed: $!";
         waitpid($pid, 0);
         ($? || $$out eq '') ? 0 : 1;