summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.c
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2010-11-05 01:29:08 +0000
committerGustavo André dos Santos Lopes <cataphract@php.net>2010-11-05 01:29:08 +0000
commit0a351335249697ef3fe0b2f9441cf30ad5cb8499 (patch)
tree5263793b4f3c02dbd87e8e764a4a0326a2c78635 /main/streams/plain_wrapper.c
parent6f1cfe3e7fe7ebb5f8ef733803ee50bfd4e63ad1 (diff)
downloadphp-git-0a351335249697ef3fe0b2f9441cf30ad5cb8499.tar.gz
- Fixed bug #53241 (stream casting that relies on fdopen/fopencookie fails
with streams opened with, inter alia, the 'xb' mode).
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 2fc0e8989a..bc5137c01f 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -490,7 +490,9 @@ static int php_stdiop_cast(php_stream *stream, int castas, void **ret TSRMLS_DC)
if (data->file == NULL) {
/* we were opened as a plain file descriptor, so we
* need fdopen now */
- data->file = fdopen(data->fd, stream->mode);
+ char fixed_mode[5];
+ php_stream_rep_nonstand_mode(stream, fixed_mode);
+ data->file = fdopen(data->fd, fixed_mode);
if (data->file == NULL) {
return FAILURE;
}