From 44cff77b95104cc99ea5625df6ebe8adfa3f4a22 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 18 Nov 2011 04:06:01 +0000 Subject: * 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 --- win32/win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'win32') 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; -- cgit v1.2.3