diff options
author | Michael Wallner <mike@php.net> | 2013-12-06 10:33:10 +0100 |
---|---|---|
committer | Michael Wallner <mike@php.net> | 2013-12-06 10:33:10 +0100 |
commit | a48d82d23824a1d81e3ab847774476485f9388a5 (patch) | |
tree | e2bda28195e62dbf7f676af309bea67e5e9d99b4 /main | |
parent | 32a4cc8353ff94d107611f00e7376e8e1baae926 (diff) | |
parent | b5f5bff965c1a27a4820d0129d61f80ef8894e38 (diff) | |
download | php-git-a48d82d23824a1d81e3ab847774476485f9388a5.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Fixed bug #61645 (fopen and O_NONBLOCK)
fix possibly uninitialized value
Diffstat (limited to 'main')
-rw-r--r-- | main/streams/plain_wrapper.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 39df31a170..02f46ab273 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -78,11 +78,7 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags) /* unknown mode */ return FAILURE; } -#if defined(O_NONBLOCK) - if (strchr(mode, 'n')) { - flags |= O_NONBLOCK; - } -#endif + if (strchr(mode, '+')) { flags |= O_RDWR; } else if (flags) { @@ -91,6 +87,12 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags) flags |= O_RDONLY; } +#if defined(O_NONBLOCK) + if (strchr(mode, 'n')) { + flags |= O_NONBLOCK; + } +#endif + #if defined(_O_TEXT) && defined(O_BINARY) if (strchr(mode, 't')) { flags |= _O_TEXT; |