[llvm] r212902 - bugpoint/ToolRunner.cpp: ProcessFailure(): Close ErrorFD immediately, or it couldn't be reopened on Win32.
geek4civic at gmail.com
Wed Jul 23 15:13:21 PDT 2014
Then I didn't want to introduce weird #ifdef and #include there.
If we had an option "Don't use FD", entire the tweak could be useless,
FYI, ::close(ErrorFD) can be not specific for Win32, but generic among
2014-07-24 7:09 GMT+09:00 Rafael Espíndola <rafael.espindola at gmail.com>:
> Why not just
> close(ErrorFD) ?
> On 13 July 2014 09:28, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
>> Author: chapuni
>> Date: Sun Jul 13 08:28:18 2014
>> New Revision: 212902
>> URL: http://llvm.org/viewvc/llvm-project?rev=212902&view=rev
>> 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
>> 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";
>> +#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);
>> RunProgramWithTimeout(ProgPath, Args, "", ErrorFilename.str(),
>> ErrorFilename.str(), Timeout, MemoryLimit);
>> // FIXME: check return code ?
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
More information about the llvm-commits