From: Todd C. Miller Date: Mon, 16 Apr 2012 14:18:32 +0000 (-0400) Subject: Include sys/mkdev.h if present instead of sys/sysmacros.h for X-Git-Tag: SUDO_1_8_5~1^2~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dbcd7222a102228921311f9606cb9bf0d13627d7;p=sudo Include sys/mkdev.h if present instead of sys/sysmacros.h for minor(). This is needed on Solaris (at least) where the makedev macros in sysmacros.h are obsolete and library functions should be used instead. --- diff --git a/config.h.in b/config.h.in index 8df0ad375..28661f9ae 100644 --- a/config.h.in +++ b/config.h.in @@ -602,6 +602,9 @@ */ #undef HAVE_SYS_DIR_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MKDEV_H + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H diff --git a/configure b/configure index 771a36440..3a54f68af 100755 --- a/configure +++ b/configure @@ -15235,7 +15235,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi -for ac_header in malloc.h netgroup.h paths.h spawn.h utime.h utmpx.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h sys/sysmacros.h +for ac_header in malloc.h netgroup.h paths.h spawn.h utime.h utmpx.h sys/sockio.h sys/bsdtypes.h sys/mkdev.h sys/select.h sys/stropts.h sys/sysmacros.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 bb6c2c54e..ff6cf442c 100644 --- a/configure.in +++ b/configure.in @@ -2006,7 +2006,7 @@ AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_TIME AC_HEADER_STDBOOL -AC_CHECK_HEADERS(malloc.h netgroup.h paths.h spawn.h utime.h utmpx.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h sys/sysmacros.h) +AC_CHECK_HEADERS(malloc.h netgroup.h paths.h spawn.h utime.h utmpx.h sys/sockio.h sys/bsdtypes.h sys/mkdev.h sys/select.h sys/stropts.h sys/sysmacros.h) AC_CHECK_HEADERS([procfs.h] [sys/procfs.h], [AC_CHECK_MEMBERS(struct psinfo.pr_ttydev, [AC_CHECK_FUNCS(_ttyname_dev)], [], [AC_INCLUDES_DEFAULT #ifdef HAVE_PROCFS_H #include diff --git a/src/ttyname.c b/src/ttyname.c index 2730a69e2..cb8c8cfa5 100644 --- a/src/ttyname.c +++ b/src/ttyname.c @@ -25,7 +25,9 @@ #include #include #include -#ifdef HAVE_SYS_SYSMACROS_H +#if defined(HAVE_SYS_MKDEV_H) +# include +#elif defined(HAVE_SYS_SYSMACROS_H) # include #endif #include