diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-28 14:01:12 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-28 14:01:12 +0000 |
commit | 3fb4d27a8d818508ab07cd3e74f1f5b89a3c2d55 (patch) | |
tree | 21eebe5814682a1b879cdec5fff6bd04f18520bb /win32/win32.c | |
parent | 26269cbd5d7827ecfba3df54e167a11076d6c59f (diff) | |
download | ruby-3fb4d27a8d818508ab07cd3e74f1f5b89a3c2d55.tar.gz |
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@26192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/win32/win32.c b/win32/win32.c index 7a81550632..e046b548d1 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); |