aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Unix
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-18 17:21:34 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-18 17:21:34 +0000
commit071d73d67e7cea60e7334f6ae96c1e8f8050a662 (patch)
treeaa5c6b099874bce274019ec634bca7558acacf4b /lib/System/Unix
parenta537bf83eda87a0eb65c278d673e51f76b0dd98b (diff)
downloadexternal_llvm-071d73d67e7cea60e7334f6ae96c1e8f8050a662.zip
external_llvm-071d73d67e7cea60e7334f6ae96c1e8f8050a662.tar.gz
external_llvm-071d73d67e7cea60e7334f6ae96c1e8f8050a662.tar.bz2
termios.h contains the winsize structure we need to determine the
width of a terminal. Don't try to get the width of a terminal if we don't have this header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Unix')
-rw-r--r--lib/System/Unix/Process.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/System/Unix/Process.inc b/lib/System/Unix/Process.inc
index b1286b7..e4f37a1 100644
--- a/lib/System/Unix/Process.inc
+++ b/lib/System/Unix/Process.inc
@@ -27,6 +27,9 @@
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#endif
//===----------------------------------------------------------------------===//
//=== WARNING: Implementation here must contain only generic UNIX code that
@@ -204,7 +207,7 @@ static unsigned getColumns(int FileID) {
unsigned Columns = 0;
-#ifdef HAVE_SYS_IOCTL_H
+#if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
// Try to determine the width of the terminal.
struct winsize ws;
if (ioctl(FileID, TIOCGWINSZ, &ws) == 0)