diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-01-12 16:14:24 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-01-12 16:14:24 +0000 |
commit | 25ca9f9ef10c26181a7c0e8dea2f26554c722efc (patch) | |
tree | 64e1b73045e8e3999f5d356e2eaf6c665f76727b /lib/Support | |
parent | f9f10e3f951ca151f2b2430ac881a4d457b92f10 (diff) | |
download | llvm-25ca9f9ef10c26181a7c0e8dea2f26554c722efc.tar.gz llvm-25ca9f9ef10c26181a7c0e8dea2f26554c722efc.tar.bz2 llvm-25ca9f9ef10c26181a7c0e8dea2f26554c722efc.tar.xz |
raw_fd_ostream: Don't change STDERR to O_BINARY, or w*printf() (in assert()) would barf wide chars after llvm::errs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199057 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/raw_ostream.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index 84f5ab592e..2d825e1509 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -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 |