]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
mda: use read_all for error handling
authorEric Wong <e@80x24.org>
Sat, 18 Jan 2025 01:26:15 +0000 (01:26 +0000)
committerEric Wong <e@80x24.org>
Tue, 21 Jan 2025 22:37:03 +0000 (22:37 +0000)
We already imported PublicInbox::IO for this script and read_all
provides more safety in case default PerlIO semantics change for
read-in-full behavior.

script/public-inbox-mda

index 9d68ea35d5de23a27e198248976bff2b51b4d256..bc1dc286ff799c7f8d9807124ef7f98247451856 100755 (executable)
@@ -100,8 +100,7 @@ if ($spamc) {
 } else { # no spam checking configured:
        $spam_ok = 1;
        $emm = $ems;
-       my $fh = $emm->fh;
-       read($fh, $str, -s $fh);
+       PublicInbox::IO::read_all $emm->fh, undef, \$str;
 }
 $do_exit->(0) unless $spam_ok;