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

Unified Diff: runtime/bin/stdio_win.cc

Issue 807833002: Revert "Make stdout/stderr async" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review commetns Created 5 years, 11 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
Index: runtime/bin/stdio_win.cc
diff --git a/runtime/bin/stdio_win.cc b/runtime/bin/stdio_win.cc
index 24ceb325cab4ca19dbbeea10c791d32d4c4bc69a..86fd939f4255c3c94709fa12bb731e5f3d18abfd 100644
--- a/runtime/bin/stdio_win.cc
+++ b/runtime/bin/stdio_win.cc
@@ -65,8 +65,13 @@ void Stdin::SetLineMode(bool enabled) {
}
-bool Stdout::GetTerminalSize(int size[2]) {
- HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
+bool Stdout::GetTerminalSize(int fd, int size[2]) {
+ HANDLE h;
+ if (fd == 1) {
+ h = GetStdHandle(STD_OUTPUT_HANDLE);
+ } else {
+ h = GetStdHandle(STD_ERROR_HANDLE);
+ }
CONSOLE_SCREEN_BUFFER_INFO info;
if (!GetConsoleScreenBufferInfo(h, &info)) return false;
size[0] = info.srWindow.Right - info.srWindow.Left + 1;

Powered by Google App Engine
This is Rietveld 408576698