Index: runtime/bin/stdio_android.cc |
diff --git a/runtime/bin/stdio_android.cc b/runtime/bin/stdio_android.cc |
index 12c87c96f32e79c9fb69f5229e0218a98e843510..25d16c32a775eaa1478d2832d2aaae9456d157cd 100644 |
--- a/runtime/bin/stdio_android.cc |
+++ b/runtime/bin/stdio_android.cc |
@@ -67,12 +67,13 @@ void Stdin::SetLineMode(bool enabled) { |
bool Stdout::GetTerminalSize(int size[2]) { |
struct winsize w; |
Søren Gjesse
2014/02/25 07:58:34
What is the exact situation here? If there are sit
Anders Johnsen
2014/02/25 08:20:47
From reading around the web, I found that it can r
|
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 |