aboutsummaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-18 04:06:01 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-18 04:06:01 +0000
commit44cff77b95104cc99ea5625df6ebe8adfa3f4a22 (patch)
treee65098cc18f65940f093056356336c4ebbf7f89d /win32
parentd6c86e631d030202f23b096a1659a495c0263c5a (diff)
downloadruby-44cff77b95104cc99ea5625df6ebe8adfa3f4a22.tar.gz
* io.c (rb_cloexec_open): set O_NOINHERIT instead of O_CLOEXEC if it is
available (for Windows). * win32/win32.c (fcntl): on F_DUPFD, determine the inheritance of the new handle by O_NOINHERIT flag of original fd. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index b570a4295d..c7f853ce81 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3849,7 +3849,8 @@ fcntl(int fd, int cmd, ...)
int ret;
HANDLE hDup;
if (!(DuplicateHandle(GetCurrentProcess(), (HANDLE)_get_osfhandle(fd),
- GetCurrentProcess(), &hDup, 0L, TRUE,
+ GetCurrentProcess(), &hDup, 0L,
+ !(_osfile(fd) & FNOINHERIT),
DUPLICATE_SAME_ACCESS))) {
errno = map_errno(GetLastError());
return -1;