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
diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp
index 9b1b64a..3efd84f 100644
--- a/libs/binder/tests/binderRpcTest.cpp
+++ b/libs/binder/tests/binderRpcTest.cpp
@@ -1168,7 +1168,8 @@
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,