Skip to content

Commit 6b1036f

Browse files
author
Hannah.Hsu
committed
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
1 parent f5883db commit 6b1036f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

libs/binder/tests/binderRpcTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,8 @@ bool testSupportVsockLoopback() {
11681168
socklen_t len = sizeof(serverAddr);
11691169
ret = getsockname(serverFd.get(), reinterpret_cast<sockaddr*>(&serverAddr), &len);
11701170
LOG_ALWAYS_FATAL_IF(0 != ret, "Failed to getsockname: %s", strerror(errno));
1171-
LOG_ALWAYS_FATAL_IF(len < sizeof(serverAddr), "getsockname didn't read the full addr struct");
1171+
LOG_ALWAYS_FATAL_IF(len < static_cast<socklen_t>(sizeof(serverAddr)),
1172+
"getsockname didn't read the full addr struct");
11721173

11731174
ret = TEMP_FAILURE_RETRY(listen(serverFd.get(), 1 /*backlog*/));
11741175
LOG_ALWAYS_FATAL_IF(0 != ret, "Could not listen socket on port %u: %s", serverAddr.svm_port,

0 commit comments

Comments
 (0)