unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 4/3] input_pipe: fix socket check
@ 2023-10-17 21:47 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-10-17 21:47 UTC (permalink / raw)
  To: meta

`-S' is the correct file test op for sockets, `-s' is for st_size.
---
 lib/PublicInbox/InputPipe.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/InputPipe.pm b/lib/PublicInbox/InputPipe.pm
index 8358ddd6..b38d8270 100644
--- a/lib/PublicInbox/InputPipe.pm
+++ b/lib/PublicInbox/InputPipe.pm
@@ -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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-17 21:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 21:47 [PATCH 4/3] input_pipe: fix socket check Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).