tools: More portable for openpty use.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 7 Mar 2017 01:29:37 +0000 (10:29 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 7 Mar 2017 01:42:28 +0000 (10:42 +0900)
* configure.ac (AC_CHECK_HEADERS): Add util.h libutil.h and termios.h.
* tools/symcryptrun.c: Include those headers.

--

This is for OpenBSD and FreeBSD.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
configure.ac
tools/symcryptrun.c

index bec7428..5fc2b85 100644 (file)
@@ -1274,7 +1274,8 @@ AC_MSG_NOTICE([checking for header files])
 AC_HEADER_STDC
 AC_CHECK_HEADERS([string.h unistd.h langinfo.h termio.h locale.h getopt.h \
                   pty.h utmp.h pwd.h inttypes.h signal.h sys/select.h     \
-                  stdint.h signal.h])
+                  stdint.h signal.h util.h libutil.h termios.h])
+
 AC_HEADER_TIME
 
 
index a72b9cf..b32d43a 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+
 #ifdef HAVE_PTY_H
 #include <pty.h>
+#else
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+#ifdef HAVE_UTIL_H
+#include <util.h>
+#endif
+#ifdef HAVE_LIBUTIL_H
+#include <libutil.h>
 #endif
+#endif
+
 #ifdef HAVE_UTMP_H
 #include <utmp.h>
 #endif