From e4fbff960f8d384ee793259ff6e13bb798114c98 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 6 Feb 2014 14:21:40 +1030 Subject: [PATCH] opt: test HAVE_SYS_TERMIOS_H via #if As ccanlint warns. Also, test TIOCGWINSZ before ioctl, rather than the header directly since it's a little orthogonal. Signed-off-by: Rusty Russell --- ccan/opt/usage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ccan/opt/usage.c b/ccan/opt/usage.c index ef33f918..ff054559 100644 --- a/ccan/opt/usage.c +++ b/ccan/opt/usage.c @@ -1,6 +1,6 @@ /* Licensed under GPLv3+ - see LICENSE file for details */ #include -#ifdef HAVE_SYS_TERMIOS_H +#if HAVE_SYS_TERMIOS_H #include #include /* Required on Solaris for struct winsize */ #endif @@ -24,7 +24,8 @@ static unsigned int get_columns(void) if (env) ws_col = atoi(env); -#ifdef HAVE_SYS_TERMIOS_H + +#ifdef TIOCGWINSZ if (!ws_col) { struct winsize w; -- 2.39.2