From: Rusty Russell Date: Thu, 6 Feb 2014 03:51:40 +0000 (+1030) Subject: opt: test HAVE_SYS_TERMIOS_H via #if X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=e4fbff960f8d384ee793259ff6e13bb798114c98 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 --- 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;