[llvm] r212902 - bugpoint/ToolRunner.cpp: ProcessFailure(): Close ErrorFD immediately, or it couldn't be reopened on Win32.

NAKAMURA Takumi geek4civic at gmail.com
Sun Jul 13 06:28:20 PDT 2014


Author: chapuni
Date: Sun Jul 13 08:28:18 2014
New Revision: 212902

URL: http://llvm.org/viewvc/llvm-project?rev=212902&view=rev
Log:
bugpoint/ToolRunner.cpp: ProcessFailure(): Close ErrorFD immediately, or it couldn't be reopened on Win32.

FIXME: We may have an option in openFileForWrite(), not to use ResultFD but to close it.

Modified:
    llvm/trunk/tools/bugpoint/ToolRunner.cpp

Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=212902&r1=212901&r2=212902&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original)
+++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Sun Jul 13 08:28:18 2014
@@ -148,6 +148,14 @@ static std::string ProcessFailure(String
     errs() << "Error making unique filename: " << EC.message() << "\n";
     exit(1);
   }
+
+#ifdef _WIN32
+  // Close ErrorFD immediately, or it couldn't be reopened on Win32.
+  // FIXME: We may have an option in openFileForWrite(), not to use ResultFD
+  // but to close it.
+  delete new raw_fd_ostream(ErrorFD, true);
+#endif
+
   RunProgramWithTimeout(ProgPath, Args, "", ErrorFilename.str(),
                         ErrorFilename.str(), Timeout, MemoryLimit);
   // FIXME: check return code ?





More information about the llvm-commits mailing list