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

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

Issue 922693002: Fix Android build (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 return NO_RETRY_EXPECTED(setsockopt(fd, 532 return NO_RETRY_EXPECTED(setsockopt(fd,
533 SOL_SOCKET, 533 SOL_SOCKET,
534 SO_BROADCAST, 534 SO_BROADCAST,
535 reinterpret_cast<char *>(&on), 535 reinterpret_cast<char *>(&on),
536 sizeof(on))) == 0; 536 sizeof(on))) == 0;
537 } 537 }
538 538
539 539
540 bool Socket::JoinMulticast( 540 bool Socket::JoinMulticast(
541 intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) { 541 intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
542 int proto = addr->addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6; 542 int proto = addr.addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
543 struct group_req mreq; 543 struct group_req mreq;
544 mreq.gr_interface = interfaceIndex; 544 mreq.gr_interface = interfaceIndex;
545 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); 545 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr));
Bill Hesse 2015/02/12 15:05:23 This line needs changed too.
Søren Gjesse 2015/02/12 15:07:11 Done.
546 return NO_RETRY_EXPECTED(setsockopt( 546 return NO_RETRY_EXPECTED(setsockopt(
547 fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0; 547 fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
548 } 548 }
549 549
550 550
551 bool Socket::LeaveMulticast( 551 bool Socket::LeaveMulticast(
552 intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) { 552 intptr_t fd, const RawAddr& addr, const RawAddr&, int interfaceIndex) {
553 int proto = addr.addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6; 553 int proto = addr.addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
554 struct group_req mreq; 554 struct group_req mreq;
555 mreq.gr_interface = interfaceIndex; 555 mreq.gr_interface = interfaceIndex;
556 memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr)); 556 memmove(&mreq.gr_group, &addr.ss, SocketAddress::GetAddrLength(addr));
557 return NO_RETRY_EXPECTED(setsockopt( 557 return NO_RETRY_EXPECTED(setsockopt(
558 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; 558 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
559 } 559 }
560 560
561 } // namespace bin 561 } // namespace bin
562 } // namespace dart 562 } // namespace dart
563 563
564 #endif // defined(TARGET_OS_ANDROID) 564 #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