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_8-177-g6526bd8


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-177-g6526bd8
Date: Sat, 26 Nov 2011 17:30:18 +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  6526bd881f3d820f4c7ab5e3ba4d9b1964e6c0b6 (commit)
      from  0847dcaaa4c9cebf863915c4eb8930c15a62515d (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=6526bd881f3d820f4c7ab5e3ba4d9b1964e6c0b6


commit 6526bd881f3d820f4c7ab5e3ba4d9b1964e6c0b6
Author: Mats Erik Andersson <address@hidden>
Date:   Sat Nov 26 11:08:16 2011 +0100

    Portability fixes discovered by Solaris.
    
    * <protocols/talkd.h> need not be present.
    * Unused code in `ftpd/logwtmp.c'.
    * Implementation of logwtmp() is needed in Solaris.

diff --git a/ChangeLog b/ChangeLog
index 87f80de..168a8c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-11-26  Mats Erik Andersson <address@hidden>
+
+       * configure.ac: Check presence of <protocols/talkd.h>. Disable
+       building of `talk' and `talkd' if it is missing.
+       * ftpd/Makefile.am (ftpd_SOURCES): Exclude unused `logwtmp.c'.
+       * libinetutils/logwtmpko.c [HAVE_UTMPX_H && SOLARIS]: Include
+       <utmpx.h>.
+       [HAVE_UPDWTMP && SOLARIS]: Implement missing `logwtmp()'.
+
 2011-11-21  Mats Erik Andersson <address@hidden>
 
        * configure.ac: Do not check for <malloc.h>.
diff --git a/configure.ac b/configure.ac
index b0259e5..5ebe9fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,6 +190,21 @@ fi
 AC_SUBST(LIBLS)
 AC_SUBST(libls_BUILD)
 
+dnl At least OpenSolaris is missing <protocols/talkd.h>.
+AC_CHECK_HEADER(protocols/talkd.h, , ,
+  [IU_FLUSHLEFT([#ifdef HAVE_SYS_TYPES_H
+                # include <sys/types.h>
+                #endif
+                #include <sys/socket.h>])])
+
+if test "$ac_cv_header_protocols_talkd_h" = no; then
+  AC_MSG_WARN([protocols/talkd.h is not available, not building talk, nor 
talkd])
+  enable_talk=no
+  talk_BUILD=''
+  enable_talkd=no
+  talkd_BUILD=''
+fi
+
 # Only talk uses curses, so only check for it if we want that
 if test "$enable_talk" != no; then
   IU_LIB_CURSES
diff --git a/ftpd/Makefile.am b/ftpd/Makefile.am
index b97d7f5..79c1c5a 100644
--- a/ftpd/Makefile.am
+++ b/ftpd/Makefile.am
@@ -23,7 +23,7 @@ inetdaemon_PROGRAMS = @ftpd_BUILD@
 
 EXTRA_PROGRAMS = ftpd
 
-ftpd_SOURCES = ftpcmd.y ftpd.c logwtmp.c popen.c pam.c auth.c \
+ftpd_SOURCES = ftpcmd.y ftpd.c popen.c pam.c auth.c \
                conf.c server_mode.c
 
 noinst_HEADERS = extern.h
diff --git a/libinetutils/logwtmpko.c b/libinetutils/logwtmpko.c
index 2818304..3e1d91c 100644
--- a/libinetutils/logwtmpko.c
+++ b/libinetutils/logwtmpko.c
@@ -19,5 +19,43 @@
 
 #include <config.h>
 
+#if HAVE_UTMPX_H && defined SOLARIS
+# include <utmpx.h>    /* updwtmp() */
+#endif
+
 #define KEEP_OPEN
 #include "logwtmp.c"
+
+/* Solaris does not provide logwtmp(3c).
+ * It is needed in addition to logwtmp_keep_open().
+ */
+#if HAVE_UPDWTMP && defined SOLARIS
+void
+logwtmp (char *line, char *name, char *host)
+{
+  struct utmp ut;
+#ifdef HAVE_STRUCT_UTMP_UT_TV
+  struct timeval tv;
+#endif
+
+  memset (&ut, 0, sizeof (ut));
+#ifdef HAVE_STRUCT_UTMP_UT_TYPE
+  ut.ut_type = USER_PROCESS;
+#endif
+  strncpy (ut.ut_line, line, sizeof ut.ut_line);
+  strncpy (ut.ut_name, name, sizeof ut.ut_name);
+#ifdef HAVE_STRUCT_UTMP_UT_HOST
+  strncpy (ut.ut_host, host, sizeof ut.ut_host);
+#endif
+
+# ifdef HAVE_STRUCT_UTMP_UT_TV
+  gettimeofday (&tv, NULL);
+  ut.ut_tv.tv_sec = tv.tv_sec;
+  ut.ut_tv.tv_usec = tv.tv_usec;
+# else
+  time (&ut.ut_time);
+# endif
+
+  updwtmp (PATH_WTMP, &ut);
+}
+#endif /* HAVE_UPDWTMP && defined SOLARIS */

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

Summary of changes:
 ChangeLog                |    9 +++++++++
 configure.ac             |   15 +++++++++++++++
 ftpd/Makefile.am         |    2 +-
 libinetutils/logwtmpko.c |   38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 63 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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