nmh-commits
[Top][All Lists]
Advanced

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

[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated


From: Ken Hornstein
Subject: [Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. e9503b88ca04e265a27d8425f9fdcb2c877500f3
Date: Tue, 17 Jan 2012 15:59:12 +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 "The nmh Mail Handling System".

The branch, master has been updated
       via  e9503b88ca04e265a27d8425f9fdcb2c877500f3 (commit)
       via  7ba29497ff3f164e2a507eda35e81f1cb0658c74 (commit)
      from  4548981fb45fbc917cc2c26b7c96b31cfa14bc9b (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/nmh.git/commit/?id=e9503b88ca04e265a27d8425f9fdcb2c877500f3


commit e9503b88ca04e265a27d8425f9fdcb2c877500f3
Author: Ken Hornstein <address@hidden>
Date:   Tue Jan 17 10:58:40 2012 -0500

    Update .gitignore with .DS_Store (seen occasionally on MacOS X systems).

diff --git a/.gitignore b/.gitignore
index 8cf8b22..db2e5c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -81,4 +81,5 @@
 *.5
 *.8
 a.out.DSYM
+.DS_Store
 RPM/

http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=7ba29497ff3f164e2a507eda35e81f1cb0658c74


commit 7ba29497ff3f164e2a507eda35e81f1cb0658c74
Author: Ken Hornstein <address@hidden>
Date:   Tue Jan 17 10:57:54 2012 -0500

    Convert from utmp functions to utmpx functions (which are in POSIX).

diff --git a/configure.ac b/configure.ac
index 3491f96..18b4ab3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -510,7 +510,7 @@ AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1,
 dnl ---------------
 dnl CHECK FUNCTIONS
 dnl ---------------
-AC_CHECK_FUNCS(writev lstat getutent nl_langinfo)
+AC_CHECK_FUNCS(writev lstat nl_langinfo)
 
 dnl Check for multibyte character set support
 if test "x$ac_cv_header_wchar_h" = "xyes" -a "x$ac_cv_header_wctype_h" = 
"xyes" \
@@ -767,8 +767,6 @@ dnl ----------------
 dnl CHECK STRUCTURES
 dnl ----------------
 
-AC_CHECK_MEMBERS(struct utmp.ut_type,,,[#include <utmp.h>])
-
 AC_STRUCT_DIRENT_D_TYPE
 
 dnl Where is <signal.h> located?  Needed as input for signames.awk
diff --git a/uip/rcvtty.c b/uip/rcvtty.c
index 1ae8576..8e659ff 100644
--- a/uip/rcvtty.c
+++ b/uip/rcvtty.c
@@ -22,17 +22,7 @@
 #include <signal.h>
 #include <fcntl.h>
 
-#include <utmp.h>
-
-#ifndef HAVE_GETUTENT
-# ifndef UTMP_FILE
-#  ifdef _PATH_UTMP
-#   define UTMP_FILE _PATH_UTMP
-#  else
-#   define UTMP_FILE "/etc/utmp"
-#  endif
-# endif
-#endif
+#include <utmpx.h>
 
 #define        SCANFMT \
 "%2(hour{dtimenow}):%02(min{dtimenow}): %<(size)%5(size) %>%<{encrypted}E%>\
@@ -91,13 +81,7 @@ main (int argc, char **argv)
     int md, vecp = 0;
     char *cp, *user, buf[BUFSIZ], tty[BUFSIZ];
     char **argp, **arguments, *vec[MAXARGS];
-#ifdef HAVE_GETUTENT
-    struct utmp * utp;
-#else
-    struct utmp ut;
-    register FILE *uf;
-#endif
-
+    struct utmpx *utp;
 #ifdef LOCALE
     setlocale(LC_ALL, "");
 #endif
@@ -172,33 +156,16 @@ main (int argc, char **argv)
 
     user = getusername();
 
-#ifdef HAVE_GETUTENT
-    setutent();
-    while ((utp = getutent()) != NULL) {
-        if (
-#ifdef HAVE_STRUCT_UTMP_UT_TYPE
-              utp->ut_type == USER_PROCESS 
-              &&
-#endif
-               utp->ut_name[0] != 0
+    setutxent();
+    while ((utp = getutxent()) != NULL) {
+        if (utp->ut_type == USER_PROCESS && utp->ut_user[0] != 0
                && utp->ut_line[0] != 0
-               && strncmp (user, utp->ut_name, sizeof(utp->ut_name)) == 0) {
+               && strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) {
             strncpy (tty, utp->ut_line, sizeof(utp->ut_line));
            alert (tty, md);
         }
     }
-    endutent();
-#else
-    if ((uf = fopen (UTMP_FILE, "r")) == NULL)
-       exit (RCV_MBX);
-    while (fread ((char *) &ut, sizeof(ut), 1, uf) == 1)
-       if (ut.ut_name[0] != 0
-               && strncmp (user, ut.ut_name, sizeof(ut.ut_name)) == 0) {
-           strncpy (tty, ut.ut_line, sizeof(ut.ut_line));
-           alert (tty, md);
-       }
-    fclose (uf);
-#endif
+    endutxent();
 
     exit (RCV_MOK);
     return 0;  /* dead code to satisfy the compiler */
diff --git a/uip/slocal.c b/uip/slocal.c
index d701e78..5026d82 100644
--- a/uip/slocal.c
+++ b/uip/slocal.c
@@ -51,17 +51,7 @@
 #include NDBM_HEADER
 #endif
 
-#include <utmp.h>
-
-#ifndef HAVE_GETUTENT
-# ifndef UTMP_FILE
-#  ifdef _PATH_UTMP
-#   define UTMP_FILE _PATH_UTMP
-#  else
-#   define UTMP_FILE "/etc/utmp"
-#  endif
-# endif
-#endif
+#include <utmpx.h>
 
 static struct swit switches[] = {
 #define        ADDRSW         0
@@ -937,62 +927,29 @@ lookup (struct pair *pairs, char *key)
  * logged in.
  */
 
-#ifdef HAVE_GETUTENT
 static int
 logged_in (void)
 {
-    struct utmp * utp;
+    struct utmpx *utp;
 
     if (utmped)
         return utmped;
 
-    setutent();
+    setutxent();
 
-    while ((utp = getutent()) != NULL) {
-        if (
-#ifdef HAVE_STRUCT_UTMP_UT_TYPE
-               utp->ut_type == USER_PROCESS
-                &&
-#endif
-               utp->ut_name[0] != 0
-                && strncmp (user, utp->ut_name, sizeof(utp->ut_name)) == 0) {
+    while ((utp = getutxent()) != NULL) {
+        if ( utp->ut_type == USER_PROCESS && utp->ut_user[0] != 0
+                && strncmp (user, utp->ut_user, sizeof(utp->ut_user)) == 0) {
             if (debug)
                 continue;
-            endutent();
+            endutxent();
             return (utmped = DONE);
         }
     }
 
-    endutent();
+    endutxent();
     return (utmped = NOTOK);
 }
-#else
-static int
-logged_in (void)
-{
-    struct utmp ut;
-    FILE *uf;
-
-    if (utmped)
-       return utmped;
-
-    if ((uf = fopen (UTMP_FILE, "r")) == NULL)
-       return NOTOK;
-
-    while (fread ((char *) &ut, sizeof(ut), 1, uf) == 1) {
-       if (ut.ut_name[0] != 0
-           && strncmp (user, ut.ut_name, sizeof(ut.ut_name)) == 0) {
-           if (debug)
-               continue;
-           fclose (uf);
-           return (utmped = DONE);
-       }
-    }
-
-    fclose (uf);
-    return (utmped = NOTOK);
-}
-#endif
 
 #define        check(t,a,b)            if (t < a || t > b) return -1
 #define        cmpar(h1,m1,h2,m2)      if (h1 < h2 || (h1 == h2 && m1 < m2)) 
return 0

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

Summary of changes:
 .gitignore   |    1 +
 configure.ac |    4 +--
 uip/rcvtty.c |   47 ++++++---------------------------------------
 uip/slocal.c |   59 +++++++--------------------------------------------------
 4 files changed, 17 insertions(+), 94 deletions(-)


hooks/post-receive
-- 
The nmh Mail Handling System



reply via email to

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