commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-207-g4ebf9


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-207-g4ebf95e
Date: Fri, 16 Nov 2012 16:43:03 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  4ebf95e90700da5cc244e7c8a18d66468c858cc6 (commit)
      from  b7a8038f64cd995f8a2afc563b80d320dc0b2866 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=4ebf95e90700da5cc244e7c8a18d66468c858cc6


commit 4ebf95e90700da5cc244e7c8a18d66468c858cc6
Author: Mats Erik Andersson <address@hidden>
Date:   Fri Nov 16 17:10:09 2012 +0100

    syslogd: Adapt to legacy utmp.
    
    The legacy implementation of the utmp structure
    is still in use within FreeBSD 8 and OpenBSD.

diff --git a/ChangeLog b/ChangeLog
index 6cf857f..5f8b23c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2012-11-16  Mats Erik Andersson  <address@hidden>
 
+       syslogd: Adapt to legacy utmp.
+
+       * configure.ac: Check for getutxent.
+       * srs/syslogd.c (wallmsg)
+       [UTMP_NAME_FUNCTION || !HAVE_GETUTXENT]: Refine
+       preprocessor conditional to let read_utmp() handle
+       systems with legacy implementation of utmp.  Adding
+       a test of !HAVE_GETUTXENT achieves this.
+
+2012-11-16  Mats Erik Andersson  <address@hidden>
+
        syslogd, talkd: Alternative utmp access.
 
        * configure.ac: Check for getutxuser.
diff --git a/configure.ac b/configure.ac
index 477726f..9ecc492 100644
--- a/configure.ac
+++ b/configure.ac
@@ -737,7 +737,7 @@ AC_FUNC_MMAP
 
 AC_CHECK_FUNCS(cfsetspeed cgetent dirfd fchdir flock \
                fork fpathconf ftruncate \
-               getcwd getmsg getpwuid_r getspnam getutxuser \
+               getcwd getmsg getpwuid_r getspnam getutxent getutxuser \
                initgroups initsetproctitle killpg \
                ptsname pututline pututxline \
                setegid seteuid setpgid \
diff --git a/src/syslogd.c b/src/syslogd.c
index f8e1f6d..4fa459a 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -122,7 +122,7 @@
 #include <error.h>
 #include <progname.h>
 #include <libinetutils.h>
-#include <readutmp.h>
+#include <readutmp.h>          /* May define UTMP_NAME_FUNCTION.  */
 #include "unused-parameter.h"
 #include "xalloc.h"
 
@@ -1518,10 +1518,10 @@ wallmsg (struct filed *f, struct iovec *iov)
 {
   static int reenter;          /* Avoid calling ourselves.  */
   STRUCT_UTMP *utp;
-#ifdef UTMP_NAME_FUNCTION      /* From module readutmp.  */
+#if defined UTMP_NAME_FUNCTION || !defined HAVE_GETUTXENT
   STRUCT_UTMP *utmpbuf;
   size_t utmp_count;
-#endif /* UTMP_NAME_FUNCTION */
+#endif /* UTMP_NAME_FUNCTION || !HAVE_GETUTXENT */
   int i;
   char *p;
   char line[sizeof (utp->ut_line) + 1];
@@ -1529,16 +1529,16 @@ wallmsg (struct filed *f, struct iovec *iov)
   if (reenter++)
     return;
 
-#ifndef UTMP_NAME_FUNCTION
+#if !defined UTMP_NAME_FUNCTION && defined HAVE_GETUTXENT
   setutxent ();
 
   while ((utp = getutxent ()))
-#else /* UTMP_NAME_FUNCTION */
+#else /* UTMP_NAME_FUNCTION || !HAVE_GETUTXENT */
   read_utmp (UTMP_FILE, &utmp_count, &utmpbuf,
             READ_UTMP_USER_PROCESS | READ_UTMP_CHECK_PIDS);
 
   for (utp = utmpbuf; utp < utmpbuf + utmp_count; utp++)
-#endif /* UTMP_NAME_FUNCTION */
+#endif /* UTMP_NAME_FUNCTION || !HAVE_GETUTXENT */
     {
       strncpy (line, utp->ut_line, sizeof (utp->ut_line));
       line[sizeof (utp->ut_line)] = '\0';
@@ -1569,9 +1569,9 @@ wallmsg (struct filed *f, struct iovec *iov)
            break;
          }
     }
-#ifdef UTMP_NAME_FUNCTION
+#if defined UTMP_NAME_FUNCTION || !defined HAVE_GETUTXENT
   free (utmpbuf);
-#else /* !UTMP_NAME_FUNCTION */
+#else /* !UTMP_NAME_FUNCTION && HAVE_GETUTXENT */
   endutxent ();
 #endif
   reenter = 0;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog     |   11 +++++++++++
 configure.ac  |    2 +-
 src/syslogd.c |   16 ++++++++--------
 3 files changed, 20 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]