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 | e924a2b8ea4782010598cebd8c1a27d7b92ed941 (patch) | |
tree | 21eebe5814682a1b879cdec5fff6bd04f18520bb /win32 | |
parent | 170da8587fcd6629fbfcaba22366946691f0c5a0 (diff) | |
download | ruby-e924a2b8ea4782010598cebd8c1a27d7b92ed941.tar.gz ruby-e924a2b8ea4782010598cebd8c1a27d7b92ed941.tar.xz ruby-e924a2b8ea4782010598cebd8c1a27d7b92ed941.zip |
* 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
Diffstat (limited to 'win32')
-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 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); |