Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: runtime/bin/socket_macos.cc

Issue 13940017: - Avoid warnings when building with clang. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 Socket::SetNonBlocking(fd); 52 Socket::SetNonBlocking(fd);
53 53
54 SocketAddress::SetAddrPort(&addr, port); 54 SocketAddress::SetAddrPort(&addr, port);
55 intptr_t result = TEMP_FAILURE_RETRY( 55 intptr_t result = TEMP_FAILURE_RETRY(
56 connect(fd, 56 connect(fd,
57 &addr.addr, 57 &addr.addr,
58 SocketAddress::GetAddrLength(addr))); 58 SocketAddress::GetAddrLength(addr)));
59 if (result == 0 || errno == EINPROGRESS) { 59 if (result == 0 || errno == EINPROGRESS) {
60 return fd; 60 return fd;
61 } 61 }
62 TEMP_FAILURE_RETRY(close(fd)); 62 VOID_TEMP_FAILURE_RETRY(close(fd));
63 return -1; 63 return -1;
64 } 64 }
65 65
66 66
67 intptr_t Socket::Available(intptr_t fd) { 67 intptr_t Socket::Available(intptr_t fd) {
68 return FDUtils::AvailableBytes(fd); 68 return FDUtils::AvailableBytes(fd);
69 } 69 }
70 70
71 71
72 int Socket::Read(intptr_t fd, void* buffer, intptr_t num_bytes) { 72 int Socket::Read(intptr_t fd, void* buffer, intptr_t num_bytes) {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 bool Socket::SetNoDelay(intptr_t fd, bool enabled) { 286 bool Socket::SetNoDelay(intptr_t fd, bool enabled) {
287 int on = enabled ? 1 : 0; 287 int on = enabled ? 1 : 0;
288 return TEMP_FAILURE_RETRY(setsockopt(fd, 288 return TEMP_FAILURE_RETRY(setsockopt(fd,
289 IPPROTO_TCP, 289 IPPROTO_TCP,
290 TCP_NODELAY, 290 TCP_NODELAY,
291 reinterpret_cast<char *>(&on), 291 reinterpret_cast<char *>(&on),
292 sizeof(on))) == 0; 292 sizeof(on))) == 0;
293 } 293 }
294 294
295 #endif // defined(TARGET_OS_MACOS) 295 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698