]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
input_pipe: fstat(2) IO properly
authorEric Wong <e@80x24.org>
Wed, 3 Jul 2024 10:52:01 +0000 (10:52 +0000)
committerEric Wong <e@80x24.org>
Thu, 4 Jul 2024 02:21:24 +0000 (02:21 +0000)
We can't rely on `_' being set for all callers.  I'm not sure
if this was a problem before, but only noticed via manual code
inspection.

lib/PublicInbox/InputPipe.pm

index ee5bda59781f91f6be329fdc11ba8ab13a29f607..77eae4edb3f5a0fc090d51c1ae44d041e58817b5 100644 (file)
@@ -14,7 +14,7 @@ sub consume {
        if ($@) { # regular file (but not w/ select|IO::Poll backends)
                $self->{-need_rq} = 1;
                $self->requeue;
-       } elsif (-p _ || -S _) { # O_NONBLOCK for sockets and pipes
+       } elsif (-p $in || -S _) { # O_NONBLOCK for sockets and pipes
                $in->blocking(0);
        }
        $self;