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

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

Issue 114303002: Fixes build of socket_android.cc (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 bool Socket::SetBroadcast(intptr_t fd, bool enabled) { 546 bool Socket::SetBroadcast(intptr_t fd, bool enabled) {
547 int on = enabled ? 1 : 0; 547 int on = enabled ? 1 : 0;
548 return TEMP_FAILURE_RETRY(setsockopt(fd, 548 return TEMP_FAILURE_RETRY(setsockopt(fd,
549 SOL_SOCKET, 549 SOL_SOCKET,
550 SO_BROADCAST, 550 SO_BROADCAST,
551 reinterpret_cast<char *>(&on), 551 reinterpret_cast<char *>(&on),
552 sizeof(on))) == 0; 552 sizeof(on))) == 0;
553 } 553 }
554 554
555 555
556 bool Socket::JoinMulticast(intptr_t fd, RawAddr* addr, int interfaceIndex) { 556 bool Socket::JoinMulticast(
557 intptr_t fd, RawAddr* addr, RawAddr*, int interfaceIndex) {
557 int proto = addr->addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6; 558 int proto = addr->addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
558 struct group_req mreq; 559 struct group_req mreq;
559 mreq.gr_interface = interfaceIndex; 560 mreq.gr_interface = interfaceIndex;
560 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); 561 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr));
561 return TEMP_FAILURE_RETRY(setsockopt( 562 return TEMP_FAILURE_RETRY(setsockopt(
562 fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0; 563 fd, proto, MCAST_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
563 } 564 }
564 565
565 566
566 bool Socket::LeaveMulticast(intptr_t fd, RawAddr* addr, int interfaceIndex) { 567 bool Socket::LeaveMulticast(
568 intptr_t fd, RawAddr* addr, RawAddr*, int interfaceIndex) {
567 int proto = addr->addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6; 569 int proto = addr->addr.sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
568 struct group_req mreq; 570 struct group_req mreq;
569 mreq.gr_interface = interfaceIndex; 571 mreq.gr_interface = interfaceIndex;
570 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); 572 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr));
571 return TEMP_FAILURE_RETRY(setsockopt( 573 return TEMP_FAILURE_RETRY(setsockopt(
572 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; 574 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
573 } 575 }
574 576
575 } // namespace bin 577 } // namespace bin
576 } // namespace dart 578 } // namespace dart
577 579
578 #endif // defined(TARGET_OS_ANDROID) 580 #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