summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ccan/opt/usage.c5
1 files 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 <ccan/opt/opt.h>
-#ifdef HAVE_SYS_TERMIOS_H
+#if HAVE_SYS_TERMIOS_H
#include <sys/ioctl.h>
#include <sys/termios.h> /* 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;