diff options
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r-- | main/streams/plain_wrapper.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 9dbc4246b5..39c629b458 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -94,6 +94,12 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags) flags |= O_RDONLY; } +#if defined(O_CLOEXEC) + if (strchr(mode, 'e')) { + flags |= O_CLOEXEC; + } +#endif + #if defined(O_NONBLOCK) if (strchr(mode, 'n')) { flags |= O_NONBLOCK; |