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

Unified Diff: runtime/bin/stdio_linux.cc

Issue 177863010: Don't report hasTerminal, if term-size is (0,0). (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
Index: runtime/bin/stdio_linux.cc
diff --git a/runtime/bin/stdio_linux.cc b/runtime/bin/stdio_linux.cc
index f61cc30319bb35b392b646baa5d3ed15113873da..43ece5241ef6ebc6743a3211a7acb1133e3e38b3 100644
--- a/runtime/bin/stdio_linux.cc
+++ b/runtime/bin/stdio_linux.cc
@@ -67,12 +67,13 @@ void Stdin::SetLineMode(bool enabled) {
bool Stdout::GetTerminalSize(int size[2]) {
struct winsize w;
if (TEMP_FAILURE_RETRY_BLOCK_SIGNALS(
- ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != 0)) {
- return false;
+ ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == 0) &&
+ (w.ws_col != 0 || w.ws_row != 0)) {
+ size[0] = w.ws_col;
+ size[1] = w.ws_row;
+ return true;
}
- size[0] = w.ws_col;
- size[1] = w.ws_row;
- return true;
+ return false;
}
} // namespace bin

Powered by Google App Engine
This is Rietveld 408576698