[Toybox] [PATCH 05/10] lib/lib.c: struct winsize is not defined in bionic.
Georgi Chorbadzhiyski
gf at unixsol.org
Wed Mar 7 16:38:57 PST 2012
---
lib/lib.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/lib/lib.c b/lib/lib.c
index cc441f9..d31e9fa 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -768,15 +768,18 @@ void crc_init(unsigned int *crc_table, int little_endian)
void terminal_size(unsigned *x, unsigned *y)
{
- struct winsize ws;
int i;
//memset(&ws, 0, sizeof(ws));
+#ifndef __ANDROID__
+ struct winsize ws;
for (i=0; i<3; i++) {
if (ioctl(i, TIOCGWINSZ, &ws)) continue;
if (x) *x = ws.ws_col;
if (y) *y = ws.ws_row;
}
+#endif
+
if (x) {
char *s = getenv("COLUMNS");
--
1.7.5.1
1331167137.0
More information about the Toybox
mailing list