changeset 11535:c55de307d9f9 HEAD

doveadm: Use struct winsize, not struct ttysize to get the terminal width.
author Timo Sirainen <tss@iki.fi>
date Sat, 12 Jun 2010 02:11:26 +0100
parents 2f3ce92f53ff
children c50d42277cc3
files src/doveadm/doveadm-print-table.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/doveadm-print-table.c	Sat Jun 12 01:54:53 2010 +0100
+++ b/src/doveadm/doveadm-print-table.c	Sat Jun 12 02:11:26 2010 +0100
@@ -167,7 +167,7 @@
 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 @@
 	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;
 	}
 }