summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-05-23 15:27:09 +0000
committerWez Furlong <wez@php.net>2003-05-23 15:27:09 +0000
commitbdcd417ad6022ce079bed02b56b7dcbe2b50e973 (patch)
tree29fbc349d1ae1e8fccf1837229c131bbc11af1a6
parentb3171064fd87accf0d1ac024c5001f913716626d (diff)
downloadphp-git-bdcd417ad6022ce079bed02b56b7dcbe2b50e973.tar.gz
Avoid greedy reads on FIFOs
-rwxr-xr-xmain/streams.c6
1 files 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);
}