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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Jul 23 15:09:34 PDT 2014


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
> 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 ?
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list