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

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

Issue 19263003: Add FileSystemWatcher class to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix android socket. Created 7 years, 3 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/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 #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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 struct stat buf; 185 struct stat buf;
186 int result = fstat(fd, &buf); 186 int result = fstat(fd, &buf);
187 if (result == -1) return -1; 187 if (result == -1) return -1;
188 if (S_ISCHR(buf.st_mode)) return File::kTerminal; 188 if (S_ISCHR(buf.st_mode)) return File::kTerminal;
189 if (S_ISFIFO(buf.st_mode)) return File::kPipe; 189 if (S_ISFIFO(buf.st_mode)) return File::kPipe;
190 if (S_ISREG(buf.st_mode)) return File::kFile; 190 if (S_ISREG(buf.st_mode)) return File::kFile;
191 return File::kOther; 191 return File::kOther;
192 } 192 }
193 193
194 194
195 intptr_t Socket::GetStdioHandle(int num) { 195 intptr_t Socket::GetStdioHandle(intptr_t num) {
196 return static_cast<intptr_t>(num); 196 return num;
197 } 197 }
198 198
199 199
200 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, 200 AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
201 int type, 201 int type,
202 OSError** os_error) { 202 OSError** os_error) {
203 // Perform a name lookup for a host name. 203 // Perform a name lookup for a host name.
204 struct addrinfo hints; 204 struct addrinfo hints;
205 memset(&hints, 0, sizeof(hints)); 205 memset(&hints, 0, sizeof(hints));
206 hints.ai_family = SocketAddress::FromType(type); 206 hints.ai_family = SocketAddress::FromType(type);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 IPPROTO_TCP, 375 IPPROTO_TCP,
376 TCP_NODELAY, 376 TCP_NODELAY,
377 reinterpret_cast<char *>(&on), 377 reinterpret_cast<char *>(&on),
378 sizeof(on))) == 0; 378 sizeof(on))) == 0;
379 } 379 }
380 380
381 } // namespace bin 381 } // namespace bin
382 } // namespace dart 382 } // namespace dart
383 383
384 #endif // defined(TARGET_OS_ANDROID) 384 #endif // defined(TARGET_OS_ANDROID)
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