summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hannah.Hsu <hannah.hsu@mediatek.com> 2024-07-09 11:20:20 +0800
committer Hannah Hsu <hannah.hsu@mediatek.com> 2024-07-11 09:30:45 +0000
commit6b1036fda07cf5462f6576b4163db265d673f038 (patch)
tree05cd2abcb7d0499444ff6ff5066ccb18fb23bea7
parentf5883db738ee9f4da2f4ef137e04367602a06094 (diff)
Fix build error
Error message: frameworks/native/libs/binder/tests/binderRpcTest.cpp:1171:29: error: comparison of integers of different signs: 'socklen_t' (aka 'int') and 'unsigned int' [-Werror,-Wsign-compare] Test Report: Build pass with the following command source build/envsetup.sh; lunch gambit-trunk_food-userdebug; m vts; Bug: b/351059357 Change-Id: Ifdf72342f3683ea4b417507157c037e12cf4c937
-rw-r--r--libs/binder/tests/binderRpcTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp
index 9b1b64ae8c..3efd84f145 100644
--- a/libs/binder/tests/binderRpcTest.cpp
+++ b/libs/binder/tests/binderRpcTest.cpp
@@ -1168,7 +1168,8 @@ bool testSupportVsockLoopback() {
socklen_t len = sizeof(serverAddr);
ret = getsockname(serverFd.get(), reinterpret_cast<sockaddr*>(&serverAddr), &len);
LOG_ALWAYS_FATAL_IF(0 != ret, "Failed to getsockname: %s", strerror(errno));
- LOG_ALWAYS_FATAL_IF(len < sizeof(serverAddr), "getsockname didn't read the full addr struct");
+ LOG_ALWAYS_FATAL_IF(len < static_cast<socklen_t>(sizeof(serverAddr)),
+ "getsockname didn't read the full addr struct");
ret = TEMP_FAILURE_RETRY(listen(serverFd.get(), 1 /*backlog*/));
LOG_ALWAYS_FATAL_IF(0 != ret, "Could not listen socket on port %u: %s", serverAddr.svm_port,