aboutsummaryrefslogtreecommitdiff
path: root/butl
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-06-16 18:10:54 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-06-18 15:05:38 +0300
commitdbd6d3ea474a8fbc6b2a8cbfeec34dbbc58f0553 (patch)
tree96ced85c18b1274d21cdd8d675e7b8fdbbc316eb /butl
parentb2733572c98ce85457b3820afe8aa2f72614b858 (diff)
Fix process standard stream redirection to work properly in MSYS
Diffstat (limited to 'butl')
-rw-r--r--butl/process.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/butl/process.cxx b/butl/process.cxx
index 4b834fb..588c0b6 100644
--- a/butl/process.cxx
+++ b/butl/process.cxx
@@ -524,15 +524,15 @@ namespace butl
// Perform standard stream redirection if requested.
//
- if (si.hStdError == GetStdHandle (STD_OUTPUT_HANDLE))
+ if (err == STDOUT_FILENO)
si.hStdError = si.hStdOutput;
- else if (si.hStdOutput == GetStdHandle (STD_ERROR_HANDLE))
+ else if (out == STDERR_FILENO)
si.hStdOutput = si.hStdError;
- if (si.hStdError == GetStdHandle (STD_INPUT_HANDLE) ||
- si.hStdOutput == GetStdHandle (STD_INPUT_HANDLE) ||
- si.hStdInput == GetStdHandle (STD_OUTPUT_HANDLE) ||
- si.hStdInput == GetStdHandle (STD_ERROR_HANDLE))
+ if (err == STDIN_FILENO ||
+ out == STDIN_FILENO ||
+ in == STDOUT_FILENO ||
+ in == STDERR_FILENO)
fail ("invalid file descriptor");
if (!CreateProcess (