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

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

Issue 154273003: Make std* blocking file-descriptors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update with bug. Created 6 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 | « runtime/bin/process.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 #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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 int result = fstat(fd, &buf); 218 int result = fstat(fd, &buf);
219 if (result == -1) return -1; 219 if (result == -1) return -1;
220 if (S_ISCHR(buf.st_mode)) return File::kTerminal; 220 if (S_ISCHR(buf.st_mode)) return File::kTerminal;
221 if (S_ISFIFO(buf.st_mode)) return File::kPipe; 221 if (S_ISFIFO(buf.st_mode)) return File::kPipe;
222 if (S_ISREG(buf.st_mode)) return File::kFile; 222 if (S_ISREG(buf.st_mode)) return File::kFile;
223 return File::kOther; 223 return File::kOther;
224 } 224 }
225 225
226 226
227 intptr_t Socket::GetStdioHandle(intptr_t num) { 227 intptr_t Socket::GetStdioHandle(intptr_t num) {
228 Socket::SetNonBlocking(num);
229 return num; 228 return num;
230 } 229 }
231 230
232 231
233 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, 232 AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
234 int type, 233 int type,
235 OSError** os_error) { 234 OSError** os_error) {
236 // Perform a name lookup for a host name. 235 // Perform a name lookup for a host name.
237 struct addrinfo hints; 236 struct addrinfo hints;
238 memset(&hints, 0, sizeof(hints)); 237 memset(&hints, 0, sizeof(hints));
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 mreq.gr_interface = interfaceIndex; 575 mreq.gr_interface = interfaceIndex;
577 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); 576 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr));
578 return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt( 577 return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt(
579 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; 578 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
580 } 579 }
581 580
582 } // namespace bin 581 } // namespace bin
583 } // namespace dart 582 } // namespace dart
584 583
585 #endif // defined(TARGET_OS_ANDROID) 584 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/bin/process.cc ('k') | runtime/bin/socket_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698