| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_MACOS) | 6 #if defined(TARGET_OS_MACOS) |
| 7 | 7 |
| 8 #include <errno.h> // NOLINT | 8 #include <errno.h> // NOLINT |
| 9 #include <stdio.h> // NOLINT | 9 #include <stdio.h> // NOLINT |
| 10 #include <stdlib.h> // NOLINT | 10 #include <stdlib.h> // NOLINT |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 if (TEMP_FAILURE_RETRY( | 217 if (TEMP_FAILURE_RETRY( |
| 218 bind(fd, | 218 bind(fd, |
| 219 reinterpret_cast<struct sockaddr *>(&server_address), | 219 reinterpret_cast<struct sockaddr *>(&server_address), |
| 220 sizeof(server_address))) < 0) { | 220 sizeof(server_address))) < 0) { |
| 221 VOID_TEMP_FAILURE_RETRY(close(fd)); | 221 VOID_TEMP_FAILURE_RETRY(close(fd)); |
| 222 return -1; | 222 return -1; |
| 223 } | 223 } |
| 224 | 224 |
| 225 if (TEMP_FAILURE_RETRY(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) { | 225 if (TEMP_FAILURE_RETRY(listen(fd, backlog > 0 ? backlog : SOMAXCONN)) != 0) { |
| 226 TEMP_FAILURE_RETRY(close(fd)); | 226 VOID_TEMP_FAILURE_RETRY(close(fd)); |
| 227 return -1; | 227 return -1; |
| 228 } | 228 } |
| 229 | 229 |
| 230 Socket::SetNonBlocking(fd); | 230 Socket::SetNonBlocking(fd); |
| 231 return fd; | 231 return fd; |
| 232 } | 232 } |
| 233 | 233 |
| 234 | 234 |
| 235 intptr_t ServerSocket::Accept(intptr_t fd) { | 235 intptr_t ServerSocket::Accept(intptr_t fd) { |
| 236 intptr_t socket; | 236 intptr_t socket; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 bool Socket::SetNoDelay(intptr_t fd, bool enabled) { | 277 bool Socket::SetNoDelay(intptr_t fd, bool enabled) { |
| 278 int on = enabled ? 1 : 0; | 278 int on = enabled ? 1 : 0; |
| 279 return TEMP_FAILURE_RETRY(setsockopt(fd, | 279 return TEMP_FAILURE_RETRY(setsockopt(fd, |
| 280 IPPROTO_TCP, | 280 IPPROTO_TCP, |
| 281 TCP_NODELAY, | 281 TCP_NODELAY, |
| 282 reinterpret_cast<char *>(&on), | 282 reinterpret_cast<char *>(&on), |
| 283 sizeof(on))) == 0; | 283 sizeof(on))) == 0; |
| 284 } | 284 } |
| 285 | 285 |
| 286 #endif // defined(TARGET_OS_MACOS) | 286 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |