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

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

Issue 24165006: Fix socket_android.cc to agree with socket_linux.cc and compile. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
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
11 #include <string.h> // NOLINT 11 #include <string.h> // NOLINT
12 #include <sys/stat.h> // NOLINT 12 #include <sys/stat.h> // NOLINT
13 #include <unistd.h> // NOLINT 13 #include <unistd.h> // NOLINT
14 #include <netinet/tcp.h> // NOLINT 14 #include <netinet/tcp.h> // NOLINT
15 15
16 #include "bin/fdutils.h" 16 #include "bin/fdutils.h"
17 #include "bin/file.h" 17 #include "bin/file.h"
18 #include "bin/log.h" 18 #include "bin/log.h"
19 #include "bin/socket.h" 19 #include "bin/socket.h"
20 20
21 21
22 namespace dart { 22 namespace dart {
23 namespace bin { 23 namespace bin {
24 24
25 SocketAddress::SocketAddress(struct sockaddr* sockaddr) { 25 SocketAddress::SocketAddress(struct sockaddr* sockaddr) {
26 ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN); 26 ASSERT(INET6_ADDRSTRLEN >= INET_ADDRSTRLEN);
27 RawAddr* raw = reinterpret_cast<RawAddr*>(sockaddr); 27 RawAddr* raw = reinterpret_cast<RawAddr*>(sockaddr);
28 const char* result;
28 if (sockaddr->sa_family == AF_INET) { 29 if (sockaddr->sa_family == AF_INET) {
29 result = inet_ntop(sockaddr->sa_family, 30 result = inet_ntop(sockaddr->sa_family,
30 &raw->in.sin_addr, 31 &raw->in.sin_addr,
31 as_string_, 32 as_string_,
32 INET_ADDRSTRLEN); 33 INET_ADDRSTRLEN);
33 } else { 34 } else {
34 ASSERT(sockaddr->sa_family == AF_INET6); 35 ASSERT(sockaddr->sa_family == AF_INET6);
35 result = inet_ntop(sockaddr->sa_family, 36 result = inet_ntop(sockaddr->sa_family,
36 &raw->in6.sin6_addr, 37 &raw->in6.sin6_addr,
37 as_string_, 38 as_string_,
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 IPPROTO_TCP, 384 IPPROTO_TCP,
384 TCP_NODELAY, 385 TCP_NODELAY,
385 reinterpret_cast<char *>(&on), 386 reinterpret_cast<char *>(&on),
386 sizeof(on))) == 0; 387 sizeof(on))) == 0;
387 } 388 }
388 389
389 } // namespace bin 390 } // namespace bin
390 } // namespace dart 391 } // namespace dart
391 392
392 #endif // defined(TARGET_OS_ANDROID) 393 #endif // defined(TARGET_OS_ANDROID)
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