Merge branch 'PHP-7.0' into PHP-7.1

* PHP-7.0:
  add 'e' flag for fopen() to enable CLOEXEC
This commit is contained in:
Anatol Belski 2017-01-07 12:36:09 +01:00
commit bba09d56e5

View File

@ -96,6 +96,12 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags)
flags |= O_RDONLY; flags |= O_RDONLY;
} }
#if defined(O_CLOEXEC)
if (strchr(mode, 'e')) {
flags |= O_CLOEXEC;
}
#endif
#if defined(O_NONBLOCK) #if defined(O_NONBLOCK)
if (strchr(mode, 'n')) { if (strchr(mode, 'n')) {
flags |= O_NONBLOCK; flags |= O_NONBLOCK;