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.
llvm-svn: 212902
This commit is contained in:
NAKAMURA Takumi 2014-07-13 13:28:18 +00:00
parent b2615aa44d
commit f0e30f6e5b
1 changed files with 8 additions and 0 deletions

View File

@ -148,6 +148,14 @@ static std::string ProcessFailure(StringRef ProgPath, const char** Args,
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 ?