From 29539516e523da957bd7337e879f968ebf3c5034 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Thu, 5 Apr 2012 11:15:22 -0400 Subject: [PATCH] FreeBSD needs libutil.h for forkpty() The header is not available everywhere, so only include it if it is present. (The extra include should be harmless on Linux by inspection.) --- configure.ac | 2 +- src/frontend/mosh-server.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a765fc7..1c58470 100644 --- a/configure.ac +++ b/configure.ac @@ -103,7 +103,7 @@ AS_IF([test x"$with_skalibs" != xno], # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h curses.h fcntl.h langinfo.h limits.h locale.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/resource.h sys/socket.h sys/time.h term.h termios.h unistd.h wchar.h wctype.h], [], [AC_MSG_ERROR([Missing required header file.])]) -AC_CHECK_HEADERS([pty.h util.h]) +AC_CHECK_HEADERS([pty.h util.h libutil.h]) AC_CHECK_HEADERS([endian.h sys/endian.h]) # Checks for typedefs, structures, and compiler characteristics. diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index 27e8e3a..743c912 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -20,6 +20,9 @@ #include #include +#ifdef HAVE_LIBUTIL_H +#include +#endif #include #include #include