Consistently use %m rather than strerror() in logging.
When I added %m to async_safe_* too, we never followed up and cleaned up
callers.
Test: treehugger
Change-Id: If81943c4c45de49f0fb4bc29cfbd3fc53d4a47fe
diff --git a/libc/bionic/system_property_set.cpp b/libc/bionic/system_property_set.cpp
index 212aafc..f7999db 100644
--- a/libc/bionic/system_property_set.cpp
+++ b/libc/bionic/system_property_set.cpp
@@ -272,10 +272,9 @@
PropertyServiceConnection connection;
if (!connection.IsValid()) {
errno = connection.GetLastError();
- async_safe_format_log(
- ANDROID_LOG_WARN, "libc",
- "Unable to set property \"%s\" to \"%s\": connection failed; errno=%d (%s)", key, value,
- errno, strerror(errno));
+ async_safe_format_log(ANDROID_LOG_WARN, "libc",
+ "Unable to set property \"%s\" to \"%s\": connection failed: %m", key,
+ value);
return -1;
}
@@ -283,8 +282,8 @@
if (!writer.WriteUint32(PROP_MSG_SETPROP2).WriteString(key).WriteString(value).Send()) {
errno = connection.GetLastError();
async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "Unable to set property \"%s\" to \"%s\": write failed; errno=%d (%s)",
- key, value, errno, strerror(errno));
+ "Unable to set property \"%s\" to \"%s\": write failed: %m", key,
+ value);
return -1;
}
@@ -292,8 +291,7 @@
if (!connection.RecvInt32(&result)) {
errno = connection.GetLastError();
async_safe_format_log(ANDROID_LOG_WARN, "libc",
- "Unable to set property \"%s\" to \"%s\": recv failed; errno=%d (%s)",
- key, value, errno, strerror(errno));
+ "Unable to set property \"%s\" to \"%s\": recv failed: %m", key, value);
return -1;
}