dovecot-2.0: doveadm: Use struct winsize, not struct ttysize to ...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jun 12 04:11:29 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/c55de307d9f9
changeset: 11535:c55de307d9f9
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jun 12 02:11:26 2010 +0100
description:
doveadm: Use struct winsize, not struct ttysize to get the terminal width.

diffstat:

 src/doveadm/doveadm-print-table.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r 2f3ce92f53ff -r c55de307d9f9 src/doveadm/doveadm-print-table.c
--- 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;
 	}
 }
 


More information about the dovecot-cvs mailing list