aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-01-12 16:14:24 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-01-12 16:14:24 +0000
commit4961f7a88828cd4bb474f962ff1fa6c68ce2a7b8 (patch)
tree018a134be5812b263f4e16948283bed33638a319 /llvm/lib/Support/raw_ostream.cpp
parentf15341c9de72ef7f69f9fc2051bfc191cd9c7cf5 (diff)
downloadllvm-4961f7a88828cd4bb474f962ff1fa6c68ce2a7b8.zip
llvm-4961f7a88828cd4bb474f962ff1fa6c68ce2a7b8.tar.gz
llvm-4961f7a88828cd4bb474f962ff1fa6c68ce2a7b8.tar.bz2
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
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 84f5ab5..2d825e1 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/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