From bdcd417ad6022ce079bed02b56b7dcbe2b50e973 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 23 May 2003 15:27:09 +0000 Subject: [PATCH] Avoid greedy reads on FIFOs --- main/streams.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/streams.c b/main/streams.c index 62b77b79b4..47b007a170 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1397,7 +1397,7 @@ PHPAPI php_stream *_php_stream_fopen_from_file(FILE *file, const char *mode STRE if (stream) { if (self->is_pipe) { - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; + stream->flags |= PHP_STREAM_FLAG_NO_SEEK | PHP_STREAM_FLAG_AVOID_BLOCKING; } else { stream->position = ftell(file); } @@ -1419,7 +1419,7 @@ PHPAPI php_stream *_php_stream_fopen_from_pipe(FILE *file, const char *mode STRE self->temp_file_name = NULL; stream = php_stream_alloc_rel(&php_stream_stdio_ops, self, 0, mode); - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; + stream->flags |= PHP_STREAM_FLAG_NO_SEEK | PHP_STREAM_FLAG_AVOID_BLOCKING; return stream; } @@ -2041,7 +2041,7 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const cha if (stream) { if (self->is_pipe) { - stream->flags |= PHP_STREAM_FLAG_NO_SEEK; + stream->flags |= PHP_STREAM_FLAG_NO_SEEK | PHP_STREAM_FLAG_AVOID_BLOCKING; } else { stream->position = lseek(self->fd, 0, SEEK_CUR); } -- 2.50.1