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

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

Issue 1916223003: Fixes NetworkInterface.list crash on Android (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | runtime/bin/socket_patch.dart » ('j') | 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 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #if defined(TARGET_OS_MACOS) 8 #if defined(TARGET_OS_MACOS)
9 9
10 #include "bin/socket.h" 10 #include "bin/socket.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 // OpenVPN's virtual device tun0. 329 // OpenVPN's virtual device tun0.
330 return false; 330 return false;
331 } 331 }
332 int family = ifa->ifa_addr->sa_family; 332 int family = ifa->ifa_addr->sa_family;
333 return ((lookup_family == family) || 333 return ((lookup_family == family) ||
334 ((lookup_family == AF_UNSPEC) && 334 ((lookup_family == AF_UNSPEC) &&
335 ((family == AF_INET) || (family == AF_INET6)))); 335 ((family == AF_INET) || (family == AF_INET6))));
336 } 336 }
337 337
338 338
339 bool Socket::ListInterfacesSupported() {
340 return true;
341 }
342
343
339 AddressList<InterfaceSocketAddress>* Socket::ListInterfaces( 344 AddressList<InterfaceSocketAddress>* Socket::ListInterfaces(
340 int type, 345 int type,
341 OSError** os_error) { 346 OSError** os_error) {
342 struct ifaddrs* ifaddr; 347 struct ifaddrs* ifaddr;
343 348
344 int status = getifaddrs(&ifaddr); 349 int status = getifaddrs(&ifaddr);
345 if (status != 0) { 350 if (status != 0) {
346 ASSERT(*os_error == NULL); 351 ASSERT(*os_error == NULL);
347 *os_error = new OSError(status, 352 *os_error = new OSError(status,
348 gai_strerror(status), 353 gai_strerror(status),
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 int interfaceIndex) { 625 int interfaceIndex) {
621 return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, false); 626 return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, false);
622 } 627 }
623 628
624 } // namespace bin 629 } // namespace bin
625 } // namespace dart 630 } // namespace dart
626 631
627 #endif // defined(TARGET_OS_MACOS) 632 #endif // defined(TARGET_OS_MACOS)
628 633
629 #endif // !defined(DART_IO_DISABLED) 634 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | runtime/bin/socket_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698