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

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: 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
« runtime/bin/stdio_patch.dart ('K') | « 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..44cb06891597380bed01b24dc46cfd011f27c6a6 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 (_getStdioHandleType(object == stdout ? 1 : 2)) {
Søren Gjesse 2014/02/07 11:05:11 Use the STDOUT_FILENO and STDERR_FILENO constants
Anders Johnsen 2014/02/14 08:43:28 They are not available in Dart.
+ 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;
« runtime/bin/stdio_patch.dart ('K') | « sdk/lib/io/file_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698