Fix build when libutil.h exists but is deprecated

This commit is contained in:
Keith Winstein
2012-04-07 20:23:59 -04:00
parent c354a69ee6
commit 4d9483bc83
2 changed files with 9 additions and 3 deletions
+5
View File
@@ -159,6 +159,11 @@ AC_CHECK_DECL([signalfd],
[Define if signalfd is available.])], [Define if signalfd is available.])],
, [[#include <sys/signalfd.h>]]) , [[#include <sys/signalfd.h>]])
AC_CHECK_DECL([forkpty],
[AC_DEFINE([FORKPTY_IN_LIBUTIL], [1],
[Define if libutil.h necessary for forkpty().])],
, [[#include <libutil.h>]])
AC_CHECK_DECL([htobe64], AC_CHECK_DECL([htobe64],
[AC_DEFINE([HAVE_HTOBE64], [1], [AC_DEFINE([HAVE_HTOBE64], [1],
[Define if htobe64 and friends exist.])], [Define if htobe64 and friends exist.])],
+4 -3
View File
@@ -20,9 +20,6 @@
#include <errno.h> #include <errno.h>
#include <locale.h> #include <locale.h>
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
#endif
#include <string.h> #include <string.h>
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>
@@ -59,6 +56,10 @@ extern "C" {
#include <util.h> #include <util.h>
#endif #endif
#if FORKPTY_IN_LIBUTIL
#include <libutil.h>
#endif
#include "networktransport.cc" #include "networktransport.cc"
typedef Network::Transport< Terminal::Complete, Network::UserStream > ServerConnection; typedef Network::Transport< Terminal::Complete, Network::UserStream > ServerConnection;