[PATCH 2/4] Add missing includes

Michael Forney
2013-10-03T09:39:28Z

sys/types.h: For u_char typedef
sys/params.h: For MAXNAMLEN
sys/ttydefaults.h: For various tty definitions (also add configure check)
---
configure.ac | 1 +
include/ttyutils.h | 3 +++
term-utils/ttymsg.c | 1 +
text-utils/display.c | 1 +
4 files changed, 6 insertions(+)

diff --git a/configure.ac b/configure.ac
index 95ff8b3..12d0bab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,7 @@ AC_CHECK_HEADERS([ \
sys/swap.h \
sys/syscall.h \
sys/time.h \
+ sys/ttydefaults.h \
sys/types.h \
sys/un.h \
unistd.h \
diff --git a/include/ttyutils.h b/include/ttyutils.h
index 13495ba..4f2fd88 100644
--- a/include/ttyutils.h
+++ b/include/ttyutils.h
@@ -13,6 +13,9 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
+#ifdef HAVE_SYS_TTYDEFAULTS_H
+#include <sys/ttydefaults.h>
+#endif

/* Some shorthands for control characters. */
#define CTL(x) ((x) ^ 0100) /* Assumes ASCII dialect */
diff --git a/term-utils/ttymsg.c b/term-utils/ttymsg.c
index d610826..8bf993c 100644
--- a/term-utils/ttymsg.c
+++ b/term-utils/ttymsg.c
@@ -41,6 +41,7 @@
*/

#include <sys/types.h>
+#include <sys/param.h>
#include <sys/uio.h>
#include <signal.h>
#include <fcntl.h>
diff --git a/text-utils/display.c b/text-utils/display.c
index 1f9a11b..1130366 100644
--- a/text-utils/display.c
+++ b/text-utils/display.c
@@ -33,6 +33,7 @@

#include <sys/param.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
--
1.8.4