diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-02-08 00:09:17 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-02-08 00:09:17 +0900 |
| commit | 5e48e01bf9941d1d257ee9b5c79142b2d43d9af1 (patch) | |
| tree | 2feaa2ac6b3763b533b1a41532cbf0e5b6d8c120 /src/AbstractDiskWriter.cc | |
| parent | ab40ee58b878f8d11b2985c705bef24a2914760a (diff) | |
Don't inherit file descriptor to child process
For non-Mingw32 build, set FD_CLOEXEC to file descriptors which live
beyond function scope. For Mingw32 build, just pass false to
bInheritHandles parameter of CreateProcessW.
Diffstat (limited to 'src/AbstractDiskWriter.cc')
| -rw-r--r-- | src/AbstractDiskWriter.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/AbstractDiskWriter.cc b/src/AbstractDiskWriter.cc index 2420b6a8..4d62bf97 100644 --- a/src/AbstractDiskWriter.cc +++ b/src/AbstractDiskWriter.cc @@ -221,6 +221,7 @@ int openFileWithFlags(const std::string& filename, int flags, util::safeStrerror(errNum).c_str()), errCode); } + util::make_fd_cloexec(fd); #if defined(__APPLE__) && defined(__MACH__) // This may reduce memory consumption on Mac OS X. fcntl(fd, F_NOCACHE, 1); |
