summaryrefslogtreecommitdiff
path: root/lib/Support/SystemUtils.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-16 05:35:58 +0000
committerChris Lattner <sabre@nondot.org>2004-04-16 05:35:58 +0000
commitbf3d2e2683b41f8bc179fea943b462bc88a56f2f (patch)
tree0b8fe57680aae2c61a049b368ec46b9b20c271e7 /lib/Support/SystemUtils.cpp
parentcd01ae5c7071fb99a665b2bbea7428d769792ab8 (diff)
downloadllvm-bf3d2e2683b41f8bc179fea943b462bc88a56f2f.tar.gz
llvm-bf3d2e2683b41f8bc179fea943b462bc88a56f2f.tar.bz2
llvm-bf3d2e2683b41f8bc179fea943b462bc88a56f2f.tar.xz
Bugpoint was not correctly capturing stderr! This caused it to "find" bugs
that didn't exist, missing the ones that do :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/SystemUtils.cpp')
-rw-r--r--lib/Support/SystemUtils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp
index dafbf98da8..a39c5ab52f 100644
--- a/lib/Support/SystemUtils.cpp
+++ b/lib/Support/SystemUtils.cpp
@@ -142,7 +142,10 @@ int llvm::RunProgramWithTimeout(const std::string &ProgramPath,
case 0: // Child
RedirectFD(StdInFile, 0); // Redirect file descriptors...
RedirectFD(StdOutFile, 1);
- RedirectFD(StdErrFile, 2);
+ if (StdOutFile != StdErrFile)
+ RedirectFD(StdErrFile, 2);
+ else
+ dup2(1, 2);
execv(ProgramPath.c_str(), (char *const *)Args);
std::cerr << "Error executing program: '" << ProgramPath;