From: Theodore Ts'o Date: Mon, 14 Jul 2008 21:49:38 +0000 (-0400) Subject: blkid: Fix portability issue if TIOCGSIZE and TIOCGWINSZ are present X-Git-Tag: v1.41.1~123 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=36f4c4080206f5ad4df37c3cb77f20df2f062266;p=tools%2Fe2fsprogs.git blkid: Fix portability issue if TIOCGSIZE and TIOCGWINSZ are present Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/blkid.c b/misc/blkid.c index d64f4ce..c7679ad 100644 --- a/misc/blkid.c +++ b/misc/blkid.c @@ -93,20 +93,20 @@ static void safe_print(const char *cp, int len) static int get_terminal_width(void) { #ifdef TIOCGSIZE - struct ttysize win; + struct ttysize t_win; #endif #ifdef TIOCGWINSZ - struct winsize win; + struct winsize w_win; #endif const char *cp; #ifdef TIOCGSIZE - if (ioctl (0, TIOCGSIZE, &win) == 0) - return (win.ts_cols); + if (ioctl (0, TIOCGSIZE, &t_win) == 0) + return (t_win.ts_cols); #endif #ifdef TIOCGWINSZ - if (ioctl (0, TIOCGWINSZ, &win) == 0) - return (win.ws_col); + if (ioctl (0, TIOCGWINSZ, &w_win) == 0) + return (w_win.ws_col); #endif cp = getenv("COLUMNS"); if (cp)