summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-07-20 11:49:46 -0700
committerDan Albert <danalbert@google.com>2014-07-21 11:10:00 -0700
commit97e31dedf056b07bcfcd46c49b60bf0798c60843 (patch)
tree376eeda115899cee701483913620a0a261b56351
parent7dd126a38ca501818b07927f310dcc0f531c0f1f (diff)
downloadbionic-97e31dedf056b07bcfcd46c49b60bf0798c60843.zip
bionic-97e31dedf056b07bcfcd46c49b60bf0798c60843.tar.gz
bionic-97e31dedf056b07bcfcd46c49b60bf0798c60843.tar.bz2
__libc_fatal should print a newline to stderr.
Change-Id: I088dc880d7488a65beac8cda95f530f3db41f112
-rw-r--r--libc/bionic/libc_logging.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp
index e656a12..d0172ed 100644
--- a/libc/bionic/libc_logging.cpp
+++ b/libc/bionic/libc_logging.cpp
@@ -620,7 +620,11 @@ static void __libc_fatal(const char* format, va_list args) {
out_vformat(os, format, args);
// log to stderr for the benefit of "adb shell" users.
- write(2, msg, strlen(msg));
+ struct iovec iov[2] = {
+ {msg, strlen(msg)},
+ {const_cast<void*>(static_cast<const void*>("\n")), 1},
+ };
+ writev(2, iov, 2);
// Log to the log for the benefit of regular app developers (whose stdout and stderr are closed).
__libc_write_log(ANDROID_LOG_FATAL, "libc", msg);