Chromium Code Reviews| Index: runtime/bin/socket_macos.cc |
| diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc |
| index 528f5ab57b38550d2a517b802875d2e95107b6b0..b9c6298b3b4e341f28feeeccb4fb4f4f59816871 100644 |
| --- a/runtime/bin/socket_macos.cc |
| +++ b/runtime/bin/socket_macos.cc |
| @@ -322,6 +322,17 @@ intptr_t ServerSocket::CreateBindListen(RawAddr addr, |
| return -1; |
| } |
| + // Test for invalid socket port 65535 (some browsers disallow it). |
| + if (port == 0 && Socket::GetPort(fd) == 65535) { |
| + // Don't close fd until we have created new. By doing that we ensure another |
| + // port. |
|
Ivan Posva
2013/06/27 01:08:55
This comment is not clear. What you probably want
Anders Johnsen
2013/06/27 16:35:57
https://codereview.chromium.org/18087003/
|
| + intptr_t new_fd = CreateBindListen(addr, 0, backlog, v6_only); |
| + int err = errno; |
| + TEMP_FAILURE_RETRY(close(fd)); |
|
Ivan Posva
2013/06/27 01:08:55
VOID_TEMP_FAILURE_RETRY
Anders Johnsen
2013/06/27 16:35:57
I can see you committed this. Thanks.
|
| + errno = err; |
| + return new_fd; |
| + } |
| + |
| if (TEMP_FAILURE_RETRY(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) { |
| VOID_TEMP_FAILURE_RETRY(close(fd)); |
| return -1; |