diff options
author | Wez Furlong <wez@php.net> | 2003-05-23 15:27:09 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2003-05-23 15:27:09 +0000 |
commit | bdcd417ad6022ce079bed02b56b7dcbe2b50e973 (patch) | |
tree | 29fbc349d1ae1e8fccf1837229c131bbc11af1a6 | |
parent | b3171064fd87accf0d1ac024c5001f913716626d (diff) | |
download | php-git-bdcd417ad6022ce079bed02b56b7dcbe2b50e973.tar.gz |
Avoid greedy reads on FIFOs
-rwxr-xr-x | main/streams.c | 6 |
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); } |