Index: runtime/bin/socket_linux.cc |
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc |
index f3b1949f621d51bcd4d0dc86bf51cca4f8184d7e..746adcf7ec041cd1f935b3fbd930deba6d0aba38 100644 |
--- a/runtime/bin/socket_linux.cc |
+++ b/runtime/bin/socket_linux.cc |
@@ -204,10 +204,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); |
@@ -225,12 +222,11 @@ intptr_t ServerSocket::CreateBindListen(const char* host, |
reinterpret_cast<struct sockaddr *>(&server_address), |
sizeof(server_address))) < 0) { |
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; |
} |