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

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

Issue 2791423002: [dart:io] Don't close stdin with a socket finalizer (Closed)
Patch Set: Address comments Created 3 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/eventhandler_win.cc ('k') | runtime/bin/file_fuchsia.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(HOST_OS_ANDROID) 6 #if defined(HOST_OS_ANDROID)
7 7
8 #include "bin/file.h" 8 #include "bin/file.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 const char* File::StringEscapedPathSeparator() { 559 const char* File::StringEscapedPathSeparator() {
560 return "/"; 560 return "/";
561 } 561 }
562 562
563 563
564 File::StdioHandleType File::GetStdioHandleType(int fd) { 564 File::StdioHandleType File::GetStdioHandleType(int fd) {
565 ASSERT((0 <= fd) && (fd <= 2)); 565 ASSERT((0 <= fd) && (fd <= 2));
566 struct stat buf; 566 struct stat buf;
567 int result = fstat(fd, &buf); 567 int result = fstat(fd, &buf);
568 if (result == -1) { 568 if (result == -1) {
569 const int kBufferSize = 1024; 569 return kOther;
570 char error_message[kBufferSize];
571 Utils::StrError(errno, error_message, kBufferSize);
572 FATAL2("Failed stat on file descriptor %d: %s", fd, error_message);
573 } 570 }
574 if (S_ISCHR(buf.st_mode)) { 571 if (S_ISCHR(buf.st_mode)) {
575 return kTerminal; 572 return kTerminal;
576 } 573 }
577 if (S_ISFIFO(buf.st_mode)) { 574 if (S_ISFIFO(buf.st_mode)) {
578 return kPipe; 575 return kPipe;
579 } 576 }
580 if (S_ISSOCK(buf.st_mode)) { 577 if (S_ISSOCK(buf.st_mode)) {
581 return kSocket; 578 return kSocket;
582 } 579 }
(...skipping 14 matching lines...) Expand all
597 return ((file_1_info.st_ino == file_2_info.st_ino) && 594 return ((file_1_info.st_ino == file_2_info.st_ino) &&
598 (file_1_info.st_dev == file_2_info.st_dev)) 595 (file_1_info.st_dev == file_2_info.st_dev))
599 ? File::kIdentical 596 ? File::kIdentical
600 : File::kDifferent; 597 : File::kDifferent;
601 } 598 }
602 599
603 } // namespace bin 600 } // namespace bin
604 } // namespace dart 601 } // namespace dart
605 602
606 #endif // defined(HOST_OS_ANDROID) 603 #endif // defined(HOST_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_win.cc ('k') | runtime/bin/file_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698