From: Ken Hornstein Date: Wed, 25 Apr 2012 18:02:33 +0000 (-0500) Subject: Disable utmpx support for systems that lack getutxent. X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=6fd2bf57267d5399994a4a4c4555c5197d50ce82;p=mmh Disable utmpx support for systems that lack getutxent. --- diff --git a/configure.ac b/configure.ac index af186fe..26b2606 100644 --- a/configure.ac +++ b/configure.ac @@ -424,7 +424,7 @@ AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1, dnl --------------- dnl CHECK FUNCTIONS dnl --------------- -AC_CHECK_FUNCS([wcwidth mbtowc writev lstat nl_langinfo]) +AC_CHECK_FUNCS([wcwidth mbtowc writev lstat nl_langinfo getutxent]) dnl Check for multibyte character set support if test "x$ac_cv_header_wchar_h" = "xyes" -a "x$ac_cv_header_wctype_h" = "xyes" \ diff --git a/uip/rcvtty.c b/uip/rcvtty.c index 048407a..63a97b9 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -22,7 +22,9 @@ #include #include +#ifdef HAVE_GETUTXENT #include +#endif /* HAVE_GETUTXENT */ #define SCANFMT \ "%2(hour{dtimenow}):%02(min{dtimenow}): %<(size)%5(size) %>%<{encrypted}E%>\ @@ -156,6 +158,7 @@ main (int argc, char **argv) user = getusername(); +#if HAVE_GETUTXENT setutxent(); while ((utp = getutxent()) != NULL) { if (utp->ut_type == USER_PROCESS && utp->ut_user[0] != 0 @@ -166,6 +169,7 @@ main (int argc, char **argv) } } endutxent(); +#endif /* HAVE_GETUTXENT */ exit (RCV_MOK); return 0; /* dead code to satisfy the compiler */ diff --git a/uip/slocal.c b/uip/slocal.c index 71e09ff..cc3c872 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -51,7 +51,9 @@ #include NDBM_HEADER #endif +#ifdef HAVE_GETUTXENT #include +#endif /* HAVE_GETUTXENT */ static struct swit switches[] = { #define ADDRSW 0 @@ -930,6 +932,7 @@ lookup (struct pair *pairs, char *key) static int logged_in (void) { +#if HAVE_GETUTXENT struct utmpx *utp; if (utmped) @@ -948,6 +951,7 @@ logged_in (void) } endutxent(); +#endif /* HAVE_GETUTXENT */ return (utmped = NOTOK); }