summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
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
commit82876bdb2a85a80bac84cece450ef891fc182f3e (patch)
treec650e2ceaeebec87fe7152c49c62dc6275915a27 /llvm/lib/Support
parent0328d75c83b595f5f61713fae6b0b07ed46248eb (diff)
downloadbcm5719-llvm-82876bdb2a85a80bac84cece450ef891fc182f3e.tar.gz
bcm5719-llvm-82876bdb2a85a80bac84cece450ef891fc182f3e.zip
Bugpoint was not correctly capturing stderr! This caused it to "find" bugs
that didn't exist, missing the ones that do :( llvm-svn: 12978
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/SystemUtils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Support/SystemUtils.cpp b/llvm/lib/Support/SystemUtils.cpp
index dafbf98da83..a39c5ab52f5 100644
--- a/llvm/lib/Support/SystemUtils.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud