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

Unified Diff: sdk/lib/io/stdio.dart

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/stdio.dart
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
index 5c1fa8f734fa04146c3194a2744b3a468a0e7e67..5b5e62f539c7b0a669d7760ca83769441ac4ed4c 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.dart
@@ -273,8 +273,12 @@ IOSink get stderr {
StdioType stdioType(object) {
if (object is _StdStream) {
object = object._stream;
- } else if (object is _StdSink) {
- object = object._sink;
+ } else if (object == stdout || object == stderr) {
+ switch (_StdIOUtils._getStdioHandleType(object == stdout ? 1 : 2)) {
+ case _STDIO_HANDLE_TYPE_TERMINAL: return StdioType.TERMINAL;
+ case _STDIO_HANDLE_TYPE_PIPE: return StdioType.PIPE;
+ case _STDIO_HANDLE_TYPE_FILE: return StdioType.FILE;
+ }
}
if (object is _FileStream) {
return StdioType.FILE;
@@ -303,4 +307,5 @@ class _StdIOUtils {
external static _getStdioOutputStream(int fd);
external static Stdin _getStdioInputStream();
external static int _socketType(nativeSocket);
+ external static _getStdioHandleType(int fd);
}
« no previous file with comments | « sdk/lib/io/file_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698