From 4724e313e04875f2166485dfe98a3fb9d3cb1155 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 21 Sep 2011 09:52:33 -0400 Subject: [PATCH] FreeBSD has libutil.h not util.h --- config.h.in | 3 +++ configure | 4 ++-- configure.in | 4 ++-- src/get_pty.c | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config.h.in b/config.h.in index c49bb5e3e..7a9c248ad 100644 --- a/config.h.in +++ b/config.h.in @@ -314,6 +314,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBUTIL_H + /* Define to 1 to enable Linux audit support. */ #undef HAVE_LINUX_AUDIT diff --git a/configure b/configure index 02dbe679c..a047164d4 100755 --- a/configure +++ b/configure @@ -16345,7 +16345,7 @@ if test "x$ac_cv_func_openpty" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENPTY 1 _ACEOF - for ac_header in util.h pty.h + for ac_header in libutil.h util.h pty.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -16398,7 +16398,7 @@ fi $as_echo "$ac_cv_lib_util_openpty" >&6; } if test "x$ac_cv_lib_util_openpty" = xyes; then : - for ac_header in util.h pty.h + for ac_header in libutil.h util.h pty.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/configure.in b/configure.in index a62c9a7f7..0f278a896 100644 --- a/configure.in +++ b/configure.in @@ -2086,9 +2086,9 @@ if test "$utmp_style" = "LEGACY"; then AC_CHECK_FUNCS(getttyent ttyslot, [break]) fi -AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(util.h pty.h, [break])], [ +AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(libutil.h util.h pty.h, [break])], [ AC_CHECK_LIB(util, openpty, [ - AC_CHECK_HEADERS(util.h pty.h, [break]) + AC_CHECK_HEADERS(libutil.h util.h pty.h, [break]) case "$SUDO_LIBS" in *-lutil*) ;; *) SUDO_LIBS="${SUDO_LIBS} -lutil";; diff --git a/src/get_pty.c b/src/get_pty.c index 4bac6b931..f303721d2 100644 --- a/src/get_pty.c +++ b/src/get_pty.c @@ -46,7 +46,9 @@ #include #include -#ifdef HAVE_UTIL_H +#if defined(HAVE_LIBUTIL_H) +# include +#elif defined(HAVE_UTIL_H) # include #endif #ifdef HAVE_PTY_H -- 2.40.0