summaryrefslogtreecommitdiffstats
path: root/liblog/logger_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'liblog/logger_write.c')
-rw-r--r--liblog/logger_write.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/liblog/logger_write.c b/liblog/logger_write.c
index 1a2d50612..43241254f 100644
--- a/liblog/logger_write.c
+++ b/liblog/logger_write.c
@@ -514,6 +514,14 @@ LIBLOG_ABI_PUBLIC void __android_log_assert(const char *cond, const char *tag,
strcpy(buf, "Unspecified assertion failed");
}
+ // Log assertion failures to stderr for the benefit of "adb shell" users
+ // and gtests (http://b/23675822).
+ struct iovec iov[2] = {
+ { buf, strlen(buf) },
+ { (char*) "\n", 1 },
+ };
+ TEMP_FAILURE_RETRY(writev(2, iov, 2));
+
__android_log_write(ANDROID_LOG_FATAL, tag, buf);
abort(); /* abort so we have a chance to debug the situation */
/* NOTREACHED */