Bugpoint was not correctly capturing stderr! This caused it to "find" bugs
authorChris Lattner <sabre@nondot.org>
Fri, 16 Apr 2004 05:35:58 +0000 (05:35 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 16 Apr 2004 05:35:58 +0000 (05:35 +0000)
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

lib/Support/SystemUtils.cpp

index dafbf98da8392d3d73232dee507373f10f5e3ce5..a39c5ab52f59afab080efb92a52f16609f4d1e7b 100644 (file)
@@ -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;