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

Side by Side Diff: runtime/bin/socket_android.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, 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
« no previous file with comments | « runtime/bin/socket.cc ('k') | runtime/bin/socket_linux.cc » ('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) 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 #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_ANDROID) 8 #if defined(TARGET_OS_ANDROID)
9 9
10 #include "bin/socket.h" 10 #include "bin/socket.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 SocketAddress::GetAddrLength(addr))) < 0) { 324 SocketAddress::GetAddrLength(addr))) < 0) {
325 VOID_TEMP_FAILURE_RETRY(close(fd)); 325 VOID_TEMP_FAILURE_RETRY(close(fd));
326 return -1; 326 return -1;
327 } 327 }
328 328
329 FDUtils::SetNonBlocking(fd); 329 FDUtils::SetNonBlocking(fd);
330 return fd; 330 return fd;
331 } 331 }
332 332
333 333
334 bool Socket::ListInterfacesSupported() {
335 return false;
336 }
337
338
334 AddressList<InterfaceSocketAddress>* Socket::ListInterfaces( 339 AddressList<InterfaceSocketAddress>* Socket::ListInterfaces(
335 int type, 340 int type,
336 OSError** os_error) { 341 OSError** os_error) {
337 // The ifaddrs.h header is not provided on Android. An Android 342 // The ifaddrs.h header is not provided on Android. An Android
338 // implementation would have to use IOCTL or netlink. 343 // implementation would have to use IOCTL or netlink.
344 ASSERT(*os_error == NULL);
345 *os_error = new OSError(-1,
346 "Listing interfaces is not supported "
347 "on this platform",
348 OSError::kSystem);
339 return NULL; 349 return NULL;
340 } 350 }
341 351
342 352
343 intptr_t ServerSocket::CreateBindListen(const RawAddr& addr, 353 intptr_t ServerSocket::CreateBindListen(const RawAddr& addr,
344 intptr_t backlog, 354 intptr_t backlog,
345 bool v6_only) { 355 bool v6_only) {
346 intptr_t fd; 356 intptr_t fd;
347 357
348 fd = NO_RETRY_EXPECTED(socket(addr.ss.ss_family, SOCK_STREAM, 0)); 358 fd = NO_RETRY_EXPECTED(socket(addr.ss.ss_family, SOCK_STREAM, 0));
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 return NO_RETRY_EXPECTED(setsockopt( 576 return NO_RETRY_EXPECTED(setsockopt(
567 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; 577 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
568 } 578 }
569 579
570 } // namespace bin 580 } // namespace bin
571 } // namespace dart 581 } // namespace dart
572 582
573 #endif // defined(TARGET_OS_ANDROID) 583 #endif // defined(TARGET_OS_ANDROID)
574 584
575 #endif // !defined(DART_IO_DISABLED) 585 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « runtime/bin/socket.cc ('k') | runtime/bin/socket_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698