From dbd6d3ea474a8fbc6b2a8cbfeec34dbbc58f0553 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 16 Jun 2016 18:10:54 +0300 Subject: Fix process standard stream redirection to work properly in MSYS --- butl/process.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'butl/process.cxx') 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 ( -- cgit v1.1