-# Copyright (C) 2016 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+
+# Default spam filter class for wrapping spamc(1)
package PublicInbox::Spamcheck::Spamc;
use strict;
use warnings;
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;