]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
input_pipe: fix socket check
authorEric Wong <e@80x24.org>
Tue, 17 Oct 2023 21:47:13 +0000 (21:47 +0000)
committerEric Wong <e@80x24.org>
Tue, 17 Oct 2023 22:15:14 +0000 (22:15 +0000)
`-S' is the correct file test op for sockets, `-s' is for st_size.

lib/PublicInbox/InputPipe.pm

index 8358ddd629ccb7b591d4dbb14d2a500da59327c5..b38d8270f68c27312753c258336bc4c425277cae 100644 (file)
@@ -39,7 +39,7 @@ sub consume {
        if ($@) { # regular file (but not w/ select|IO::Poll backends)
                $self->{-need_rq} = 1;
                $self->requeue;
-       } elsif (-p $in || -s _) { # O_NONBLOCK for sockets and pipes
+       } elsif (-p $in || -S _) { # O_NONBLOCK for sockets and pipes
                $in->blocking(0);
        } elsif (-t $in) { # isatty(3) can't use `_' stat cache
                unblock_tty($self);