]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Use struct winsize, not struct ttysize to get the terminal width.
authorTimo Sirainen <tss@iki.fi>
Sat, 12 Jun 2010 01:11:26 +0000 (02:11 +0100)
committerTimo Sirainen <tss@iki.fi>
Sat, 12 Jun 2010 01:11:26 +0000 (02:11 +0100)
--HG--
branch : HEAD

src/doveadm/doveadm-print-table.c

index e8da9253eec567106686e9cf35a2f789939d2ae9..ea26bdcb0188b05dcfd28cc68be16d393c5cba55 100644 (file)
@@ -167,7 +167,7 @@ static void doveadm_print_table_print(const char *value)
 static void doveadm_print_table_init(void)
 {
        pool_t pool;
-       struct ttysize ts;
+       struct winsize ws;
 
        pool = pool_alloconly_create("doveadm print table", 1024);
        ctx = p_new(pool, struct doveadm_print_table_context, 1);
@@ -176,9 +176,9 @@ static void doveadm_print_table_init(void)
        i_array_init(&ctx->buffered_values, 64);
        ctx->columns = DEFAULT_COLUMNS;
 
-       if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ts) == 0) {
-               ctx->columns = ts.ts_cols < MIN_COLUMNS ?
-                       MIN_COLUMNS : ts.ts_cols;
+       if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == 0) {
+               ctx->columns = ws.ws_col < MIN_COLUMNS ?
+                       MIN_COLUMNS : ws.ws_col;
        }
 }