libbinder: statusToString for status_t errors
'-status' for status=UNKNOWN_ERROR is UB, since that is
min integer. To avoid this, use the better function
which will also avoid this area. Only the cases that
matter are cleaned up.
Fixes: 354371732
Test: build
Change-Id: I0a71cd2c04680221191c7d926a64bda08012951f
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp
index b8742af..c7851dc 100644
--- a/libs/binder/RpcServer.cpp
+++ b/libs/binder/RpcServer.cpp
@@ -503,7 +503,7 @@
auto status = binder::os::getRandomBytes(sessionId.data(), sessionId.size());
if (status != OK) {
- ALOGE("Failed to read random session ID: %s", strerror(-status));
+ ALOGE("Failed to read random session ID: %s", statusToString(status).c_str());
return;
}
} while (server->mSessions.end() != server->mSessions.find(sessionId));