ascii: Always include <sys/ioctl.h> if we're calling ioctl.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 21 Feb 2021 18:32:37 +0000 (10:32 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 21 Feb 2021 18:32:47 +0000 (10:32 -0800)
This file included sys/ioctl.h if it was necessary to use the TIOCGWINSZ
constant, but in fact it's needed to call ioctl() at all, so this commit
moves the #include so that it's included whenever we use ioctl().

Bug #60069.
Reported by Jeremy Lavergne.

src/output/ascii.c

index ee87fa22e37c3341071239ef1e3c90899ef6036d..cd5fcec64b06ab8c704f4b2fa9b3157089e59450 100644 (file)
 #include <uniwidth.h>
 
 #ifdef HAVE_TERMIOS_H
-# include <termios.h>
-#endif
-
-#ifdef GWINSZ_IN_SYS_IOCTL
 # include <sys/ioctl.h>
+# include <termios.h>
 #endif
 
 #include "data/file-name.h"