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

Side by Side Diff: runtime/bin/socket_macos.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/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 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_MACOS) 6 #if defined(TARGET_OS_MACOS)
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 int result = fstat(fd, &buf); 219 int result = fstat(fd, &buf);
220 if (result == -1) return -1; 220 if (result == -1) return -1;
221 if (S_ISCHR(buf.st_mode)) return File::kTerminal; 221 if (S_ISCHR(buf.st_mode)) return File::kTerminal;
222 if (S_ISFIFO(buf.st_mode)) return File::kPipe; 222 if (S_ISFIFO(buf.st_mode)) return File::kPipe;
223 if (S_ISREG(buf.st_mode)) return File::kFile; 223 if (S_ISREG(buf.st_mode)) return File::kFile;
224 return File::kOther; 224 return File::kOther;
225 } 225 }
226 226
227 227
228 intptr_t Socket::GetStdioHandle(intptr_t num) { 228 intptr_t Socket::GetStdioHandle(intptr_t num) {
229 Socket::SetNonBlocking(num);
230 return num; 229 return num;
231 } 230 }
232 231
233 232
234 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, 233 AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
235 int type, 234 int type,
236 OSError** os_error) { 235 OSError** os_error) {
237 // Perform a name lookup for a host name. 236 // Perform a name lookup for a host name.
238 struct addrinfo hints; 237 struct addrinfo hints;
239 memset(&hints, 0, sizeof(hints)); 238 memset(&hints, 0, sizeof(hints));
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 636
638 bool Socket::LeaveMulticast( 637 bool Socket::LeaveMulticast(
639 intptr_t fd, RawAddr* addr, RawAddr* interface, int interfaceIndex) { 638 intptr_t fd, RawAddr* addr, RawAddr* interface, int interfaceIndex) {
640 return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, false); 639 return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, false);
641 } 640 }
642 641
643 } // namespace bin 642 } // namespace bin
644 } // namespace dart 643 } // namespace dart
645 644
646 #endif // defined(TARGET_OS_MACOS) 645 #endif // defined(TARGET_OS_MACOS)
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