From a1a580c012107f8bf26d62973c04abd58b3895d0 Mon Sep 17 00:00:00 2001 From: Mikko Koppanen Date: Sat, 11 Apr 2009 11:44:06 +0000 Subject: [PATCH] Added support for passing O_NONBLOCK to the underlying open() system call --- main/streams/plain_wrapper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.50.1