Index: runtime/bin/socket_macos.cc |
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc |
index 06422c4aba728dac753e0b6d0a999855ace261c5..50ad16ffaa1209564a1e3f1b9f079f569f6c9410 100644 |
--- a/runtime/bin/socket_macos.cc |
+++ b/runtime/bin/socket_macos.cc |
@@ -200,10 +200,7 @@ intptr_t ServerSocket::CreateBindListen(const char* host, |
} |
fd = TEMP_FAILURE_RETRY(socket(AF_INET, SOCK_STREAM, 0)); |
- if (fd < 0) { |
- Log::PrintErr("Error CreateBind: %s\n", strerror(errno)); |
- return -1; |
- } |
+ if (fd < 0) return -1; |
FDUtils::SetCloseOnExec(fd); |
@@ -221,12 +218,11 @@ intptr_t ServerSocket::CreateBindListen(const char* host, |
reinterpret_cast<struct sockaddr *>(&server_address), |
sizeof(server_address))) < 0) { |
VOID_TEMP_FAILURE_RETRY(close(fd)); |
- Log::PrintErr("Error Bind: %s\n", strerror(errno)); |
return -1; |
} |
- if (TEMP_FAILURE_RETRY(listen(fd, backlog)) != 0) { |
- Log::PrintErr("Error Listen: %s\n", strerror(errno)); |
+ if (TEMP_FAILURE_RETRY(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) { |
+ TEMP_FAILURE_RETRY(close(fd)); |
return -1; |
} |