From: Mikko Koppanen Date: Sat, 11 Apr 2009 11:44:06 +0000 (+0000) Subject: Added support for passing O_NONBLOCK to the underlying open() system call X-Git-Tag: php-5.4.0alpha1~191^2~3933 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1a580c012107f8bf26d62973c04abd58b3895d0;p=php Added support for passing O_NONBLOCK to the underlying open() system call --- diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index a65c25232f..5a4f1b6e16 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -67,7 +67,11 @@ 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) {