diff options
author | 2024-08-27 11:48:30 +0100 | |
---|---|---|
committer | 2024-08-28 16:02:34 +0000 | |
commit | 733610f6835183cc67407280cc51af4b77273248 (patch) | |
tree | e839955dae903419f211c1f2c2895d108c971ad4 /libs/binder/Parcel.cpp | |
parent | a3dba622d541aa7aaf530cbe531a7d003b12ac49 (diff) |
Mark the return of munmap() as unused.
Allow munmap() to be marked with nodiscard / warn_unused_result attribute without causing a warning or error here.
Bug: 361754857
Test: build.py
Change-Id: I49f85c79c8741b28e5baca35431a59288e07d862
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r-- | libs/binder/Parcel.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index f30b2aa3f4..925cb23cf1 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1725,7 +1725,9 @@ status_t Parcel::writeBlob(size_t len, bool mutableCopy, WritableBlob* outBlob) } } } - ::munmap(ptr, len); + if (::munmap(ptr, len) == -1) { + ALOGW("munmap() failed: %s", strerror(errno)); + } } ::close(fd); return status; @@ -3331,7 +3333,9 @@ Parcel::Blob::~Blob() { void Parcel::Blob::release() { if (mFd != -1 && mData) { - ::munmap(mData, mSize); + if (::munmap(mData, mSize) == -1) { + ALOGW("munmap() failed: %s", strerror(errno)); + } } clear(); } |