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);
}
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;
}
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);
}