[Win] Put ChangeStdinToBinary ChangeStdoutToBinary ChangeStderrToBinary in sys.

llvm-svn: 183868
This commit is contained in:
Rafael Espindola 2013-06-12 21:25:04 +00:00
parent 9754b94487
commit 564db35ed3

View File

@ -421,21 +421,21 @@ static int Wait(void *&Data, const Path &path,
} }
namespace llvm { namespace llvm {
error_code ChangeStdinToBinary(){ error_code sys::ChangeStdinToBinary(){
int result = _setmode( _fileno(stdin), _O_BINARY ); int result = _setmode( _fileno(stdin), _O_BINARY );
if (result == -1) if (result == -1)
return error_code(errno, generic_category()); return error_code(errno, generic_category());
return make_error_code(errc::success); return make_error_code(errc::success);
} }
error_code ChangeStdoutToBinary(){ error_code sys::ChangeStdoutToBinary(){
int result = _setmode( _fileno(stdout), _O_BINARY ); int result = _setmode( _fileno(stdout), _O_BINARY );
if (result == -1) if (result == -1)
return error_code(errno, generic_category()); return error_code(errno, generic_category());
return make_error_code(errc::success); return make_error_code(errc::success);
} }
error_code ChangeStderrToBinary(){ error_code sys::ChangeStderrToBinary(){
int result = _setmode( _fileno(stderr), _O_BINARY ); int result = _setmode( _fileno(stderr), _O_BINARY );
if (result == -1) if (result == -1)
return error_code(errno, generic_category()); return error_code(errno, generic_category());