Fix belated review comments on syslog change.
Bug: 14292866
(cherry picked from commit afe6360627ef3f0e9bc8f45535fbfae3354f3ae0)
Change-Id: I8e3cc6b37b2539e51a27261ffb5d6e58266ce11d
diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp
index 88d9790..cdbf723 100644
--- a/libc/bionic/libc_logging.cpp
+++ b/libc/bionic/libc_logging.cpp
@@ -230,6 +230,7 @@
/* Perform formatted output to an output target 'o' */
template <typename Out>
static void out_vformat(Out& o, const char* format, va_list args) {
+ int caller_errno = errno;
int nn = 0;
for (;;) {
@@ -380,7 +381,7 @@
buffer[1] = '\0';
} else if (c == 'm') {
// syslog-like %m for strerror(errno).
- str = strerror(errno);
+ str = strerror(caller_errno);
} else {
__assert(__FILE__, __LINE__, "conversion specifier unsupported");
}