From c4fe2466bea56ee8531c31f3b8b990713499ecd8 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Tue, 22 Oct 2024 00:01:25 +0000 Subject: 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 --- libs/binder/Parcel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libs/binder/Parcel.cpp') diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 37113629a8..2d65cf53c8 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -668,7 +668,8 @@ status_t Parcel::appendFrom(const Parcel* parcel, size_t offset, size_t len) { // FD was unowned in the source parcel. int newFd = -1; if (status_t status = binder::os::dupFileDescriptor(oldFd, &newFd); status != OK) { - ALOGW("Failed to duplicate file descriptor %d: %s", oldFd, strerror(-status)); + ALOGW("Failed to duplicate file descriptor %d: %s", oldFd, + statusToString(status).c_str()); } rpcFields->mFds->emplace_back(unique_fd(newFd)); // Fixup the index in the data. -- cgit v1.2.3-59-g8ed1b