From e924a2b8ea4782010598cebd8c1a27d7b92ed941 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 28 Dec 2009 14:01:12 +0000 Subject: * win32/win32.c (CreateChild): force to inherit standard I/O handles. this change fixes [ruby-core:27273], but other side effects might exist. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'win32') diff --git a/win32/win32.c b/win32/win32.c index 7a8155063..e046b548d 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -956,26 +956,24 @@ CreateChild(const char *cmd, const char *prog, SECURITY_ATTRIBUTES *psa, memset(&aStartupInfo, 0, sizeof (STARTUPINFO)); memset(&aProcessInformation, 0, sizeof (PROCESS_INFORMATION)); aStartupInfo.cb = sizeof (STARTUPINFO); - if (hInput || hOutput || hError) { - aStartupInfo.dwFlags = STARTF_USESTDHANDLES; - if (hInput) { - aStartupInfo.hStdInput = hInput; - } - else { - aStartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - } - if (hOutput) { - aStartupInfo.hStdOutput = hOutput; - } - else { - aStartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); - } - if (hError) { - aStartupInfo.hStdError = hError; - } - else { - aStartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE); - } + aStartupInfo.dwFlags = STARTF_USESTDHANDLES; + if (hInput) { + aStartupInfo.hStdInput = hInput; + } + else { + aStartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + } + if (hOutput) { + aStartupInfo.hStdOutput = hOutput; + } + else { + aStartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); + } + if (hError) { + aStartupInfo.hStdError = hError; + } + else { + aStartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE); } dwCreationFlags = (NORMAL_PRIORITY_CLASS); -- cgit