forked from OSchip/llvm-project
raw_fd_ostream: Don't change STDERR to O_BINARY, or w*printf() (in assert()) would barf wide chars after llvm::errs().
llvm-svn: 199057
This commit is contained in:
parent
f15341c9de
commit
4961f7a888
|
@ -469,9 +469,10 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered)
|
|||
: raw_ostream(unbuffered), FD(fd),
|
||||
ShouldClose(shouldClose), Error(false), UseAtomicWrites(false) {
|
||||
#ifdef O_BINARY
|
||||
// Setting STDOUT and STDERR to binary mode is necessary in Win32
|
||||
// Setting STDOUT to binary mode is necessary in Win32
|
||||
// to avoid undesirable linefeed conversion.
|
||||
if (fd == STDOUT_FILENO || fd == STDERR_FILENO)
|
||||
// Don't touch STDERR, or w*printf() (in assert()) would barf wide chars.
|
||||
if (fd == STDOUT_FILENO)
|
||||
setmode(fd, O_BINARY);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue