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, posix, updated.


From: Lyndon Nerenberg
Subject: [Nmh-commits] [SCM] The nmh Mail Handling System branch, posix, updated. cc1bbf24264d1b349f1521f4b0831e8caf63678e
Date: Sun, 25 Dec 2011 20:10:33 +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, posix has been updated
       via  cc1bbf24264d1b349f1521f4b0831e8caf63678e (commit)
      from  443c174bbffb1a91b0ff46ca13ea3a58cd49f303 (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=cc1bbf24264d1b349f1521f4b0831e8caf63678e


commit cc1bbf24264d1b349f1521f4b0831e8caf63678e
Author: Lyndon Nerenberg <address@hidden>
Date:   Sun Dec 25 12:09:21 2011 -0800

    Clean up process wait to use POSIX waitpid() interface.

diff --git a/config.h b/config.h
index 186a310..a462685 100644
--- a/config.h
+++ b/config.h
@@ -182,9 +182,6 @@
 /* Define to 1 if you have the `mbtowc' function. */
 #define HAVE_MBTOWC 1
 
-/* Define to 1 if you have the `mkstemp' function. */
-#define HAVE_MKSTEMP 1
-
 /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
 /* #undef HAVE_NDIR_H */
 
@@ -227,30 +224,18 @@
 /* Define to 1 if you have the <sys/utsname.h> header file. */
 #define HAVE_SYS_UTSNAME_H 1
 
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
 /* Define to 1 if you have the <termcap.h> header file. */
 #define HAVE_TERMCAP_H 1
 
 /* Define to 1 if you have the `tzset' function. */
 #define HAVE_TZSET 1
 
-/* Define to 1 if you have the \`union wait' type in <sys/wait.h>. */
-/* #undef HAVE_UNION_WAIT */
-
 /* Define to 1 if you have the `vfork' function. */
 #define HAVE_VFORK 1
 
 /* Define to 1 if you have the <vfork.h> header file. */
 /* #undef HAVE_VFORK_H */
 
-/* Define to 1 if you have the `wait3' function. */
-#define HAVE_WAIT3 1
-
-/* Define to 1 if you have the `waitpid' function. */
-#define HAVE_WAITPID 1
-
 /* Define to 1 if you have the <wchar.h> header file. */
 #define HAVE_WCHAR_H 1
 
diff --git a/h/prototypes.h b/h/prototypes.h
index d88cf8e..1c55136 100644
--- a/h/prototypes.h
+++ b/h/prototypes.h
@@ -77,8 +77,6 @@ char *m_maildir (char *);
 char *m_mailpath (char *);
 char *m_name (int);
 int m_putenv (char *, char *);
-char *m_scratch (char *, char *);
-char *m_tmpfil (char *);
 char *m_mktemp(const char *, int *, FILE **);
 char *m_mktemp2(const char *, const char *, int *, FILE **);
 void m_unknown(FILE *);
diff --git a/sbr/Makefile b/sbr/Makefile
index b5fe175..0f4f788 100644
--- a/sbr/Makefile
+++ b/sbr/Makefile
@@ -61,7 +61,7 @@ SRCS = addrsbr.c ambigsw.c atooi.c brkstring.c                
        \
        fmt_addr.c fmt_compile.c fmt_new.c fmt_rfc2047.c                \
        fmt_scan.c lock_file.c m_atoi.c m_backup.c                      \
        m_convert.c m_draft.c m_getfld.c m_gmprot.c                     \
-       m_maildir.c m_name.c m_scratch.c m_tmpfil.c                     \
+       m_maildir.c m_name.c                                            \
        makedir.c mts.c norm_charmap.c                                  \
        path.c peekc.c pidwait.c pidstatus.c                            \
        print_help.c print_sw.c print_version.c push.c                  \
diff --git a/sbr/lock_file.c b/sbr/lock_file.c
index f831949..905b287 100644
--- a/sbr/lock_file.c
+++ b/sbr/lock_file.c
@@ -431,18 +431,8 @@ lockit (struct lockinfo *li)
     curlock = li->curlock;
     tmplock = li->tmplock;
 
-#ifdef HAVE_MKSTEMP
     if ((fd = mkstemp(tmplock)) == -1)
        return -1;
-#else
-    if (mktemp(tmplock) == NULL)
-       return -1;
-    if (unlink(tmplock) == -1 && errno != ENOENT)
-       return -1;
-    /* create the temporary lock file */
-    if ((fd = creat(tmplock, 0600)) == -1)
-       return -1;
-#endif
 
 #if 0
     /* write our process id into lock file */
diff --git a/sbr/pidstatus.c b/sbr/pidstatus.c
index f16f7e0..7da78ac 100644
--- a/sbr/pidstatus.c
+++ b/sbr/pidstatus.c
@@ -14,10 +14,6 @@
  */
 #include <sigmsg.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 #ifndef WTERMSIG
 # define WTERMSIG(s) ((int)((s) & 0x7F))
 #endif
diff --git a/sbr/pidwait.c b/sbr/pidwait.c
index ef42e1a..f454161 100644
--- a/sbr/pidwait.c
+++ b/sbr/pidwait.c
@@ -12,21 +12,13 @@
 #include <errno.h>
 #include <signal.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 int
 pidwait (pid_t id, int sigsok)
 {
     pid_t pid;
     SIGNAL_HANDLER istat = NULL, qstat = NULL;
 
-#ifdef HAVE_UNION_WAIT
-    union wait status;
-#else
     int status;
-#endif
 
     if (sigsok == -1) {
        /* ignore a couple of signals */
@@ -34,13 +26,8 @@ pidwait (pid_t id, int sigsok)
        qstat = SIGNAL (SIGQUIT, SIG_IGN);
     }
 
-#ifdef HAVE_WAITPID
     while ((pid = waitpid(id, &status, 0)) == -1 && errno == EINTR)
        ;
-#else
-    while ((pid = wait(&status)) != -1 && pid != id)
-       continue;
-#endif
 
     if (sigsok == -1) {
        /* reset the signal handlers */
@@ -48,9 +35,5 @@ pidwait (pid_t id, int sigsok)
        SIGNAL (SIGQUIT, qstat);
     }
 
-#ifdef HAVE_UNION_WAIT
-    return (pid == -1 ? -1 : status.w_status);
-#else
     return (pid == -1 ? -1 : status);
-#endif
 }
diff --git a/uip/mhbuild.c b/uip/mhbuild.c
index 1e86290..d7a3cf0 100644
--- a/uip/mhbuild.c
+++ b/uip/mhbuild.c
@@ -20,10 +20,6 @@
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 static struct swit switches[] = {
 #define        CHECKSW                 0
     { "check", 0 },
diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c
index f01abd5..a36941f 100644
--- a/uip/mhbuildsbr.c
+++ b/uip/mhbuildsbr.c
@@ -38,10 +38,6 @@
 # endif
 #endif
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 
 extern int debugsw;
 extern int verbosw;
diff --git a/uip/mhcachesbr.c b/uip/mhcachesbr.c
index 2223e80..79d6bda 100644
--- a/uip/mhcachesbr.c
+++ b/uip/mhcachesbr.c
@@ -32,10 +32,6 @@
 # endif
 #endif
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 extern int debugsw;
 
 extern pid_t xpid;     /* mhshowsbr.c or mhbuildsbr.c */
diff --git a/uip/mhlist.c b/uip/mhlist.c
index cb6a3cf..6ef455d 100644
--- a/uip/mhlist.c
+++ b/uip/mhlist.c
@@ -20,10 +20,6 @@
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 static struct swit switches[] = {
 #define        CHECKSW                 0
     { "check", 0 },
diff --git a/uip/mhn.c b/uip/mhn.c
index a7644a3..2ce21d3 100644
--- a/uip/mhn.c
+++ b/uip/mhn.c
@@ -20,10 +20,6 @@
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 static struct swit switches[] = {
 #define        AUTOSW                  0
     { "auto", 0 },
diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c
index 7e12c46..2651452 100644
--- a/uip/mhoutsbr.c
+++ b/uip/mhoutsbr.c
@@ -19,10 +19,6 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 
 extern int ebcdicsw;
 
diff --git a/uip/mhparse.c b/uip/mhparse.c
index d40d78c..14322ab 100644
--- a/uip/mhparse.c
+++ b/uip/mhparse.c
@@ -20,10 +20,6 @@
 #include <h/mhparse.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 
 extern int debugsw;
 
diff --git a/uip/mhshow.c b/uip/mhshow.c
index 191eeff..722dcf6 100644
--- a/uip/mhshow.c
+++ b/uip/mhshow.c
@@ -20,10 +20,6 @@
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 static struct swit switches[] = {
 #define        CHECKSW                 0
     { "check", 0 },
diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c
index a63b8ed..d12266e 100644
--- a/uip/mhshowsbr.c
+++ b/uip/mhshowsbr.c
@@ -20,10 +20,6 @@
 #include <h/mhparse.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 /*
  * Just use sigjmp/longjmp on older machines that
  * don't have sigsetjmp/siglongjmp.
@@ -132,11 +128,7 @@ show_single_message (CT ct, char *form)
 {
     sigset_t set, oset;
 
-#ifdef HAVE_UNION_WAIT
-    union wait status;
-#else
     int status;
-#endif
 
     /* Allow user executable bit so that temporary directories created by
      * the viewer (e.g., lynx) are going to be accessible */
@@ -170,11 +162,7 @@ show_single_message (CT ct, char *form)
     SIGPROCMASK (SIG_BLOCK, &set, &oset);
 
     while (wait (&status) != NOTOK) {
-#ifdef HAVE_UNION_WAIT
-       pidcheck (status.w_status);
-#else
        pidcheck (status);
-#endif
        continue;
     }
 
@@ -783,11 +771,7 @@ show_multi_internal (CT ct, int serial, int alternate)
     if (serial && !nowserial) {
        pid_t pid;
        int kids;
-#ifdef HAVE_UNION_WAIT
-       union wait status;
-#else
        int status;
-#endif
 
        kids = 0;
        for (part = m->mp_parts; part; part = part->mp_next) {
@@ -802,11 +786,7 @@ show_multi_internal (CT ct, int serial, int alternate)
        }
 
        while (kids > 0 && (pid = wait (&status)) != NOTOK) {
-#ifdef HAVE_UNION_WAIT
-           pidcheck (status.w_status);
-#else
            pidcheck (status);
-#endif
 
            for (part = m->mp_parts; part; part = part->mp_next) {
                p = part->mp_part;
diff --git a/uip/mhstore.c b/uip/mhstore.c
index 7b44a96..5bc8daa 100644
--- a/uip/mhstore.c
+++ b/uip/mhstore.c
@@ -20,10 +20,6 @@
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 static struct swit switches[] = {
 #define        AUTOSW                  0
     { "auto", 0 },
diff --git a/uip/mhtest.c b/uip/mhtest.c
index 5c10b8b..022f6c4 100644
--- a/uip/mhtest.c
+++ b/uip/mhtest.c
@@ -20,10 +20,6 @@
 #include <h/mhcachesbr.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 static struct swit switches[] = {
 #define        CHECKSW                 0
     { "check", 0 },
diff --git a/uip/rcvtty.c b/uip/rcvtty.c
index 219af22..07053d2 100644
--- a/uip/rcvtty.c
+++ b/uip/rcvtty.c
@@ -223,13 +223,7 @@ message_fd (char **vec)
     char tmpfil[BUFSIZ];
     struct stat st;
 
-#ifdef HAVE_MKSTEMP
     fd = mkstemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil)));
-#else
-    unlink (mktemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil))));
-    if ((fd = open (tmpfil, O_RDWR | O_CREAT | O_TRUNC, 0600)) == NOTOK)
-       return header_fd ();
-#endif
     unlink (tmpfil);
 
     if ((child_id = vfork()) == NOTOK) {
diff --git a/uip/spost.c b/uip/spost.c
index c7582ba..e9e44a8 100644
--- a/uip/spost.c
+++ b/uip/spost.c
@@ -350,15 +350,8 @@ main (int argc, char **argv)
        out = stdout;
     }
     else {
-#ifdef HAVE_MKSTEMP
            if ((out = fdopen( mkstemp (tmpfil), "w" )) == NULL )
                adios (tmpfil, "unable to create");
-#else
-           mktemp (tmpfil);
-           if ((out = fopen (tmpfil, "w")) == NULL)
-               adios (tmpfil, "unable to create");
-           chmod (tmpfil, 0600);
-#endif
        }
 
     hdrtab = (msgstate == normal) ? NHeaders : RHeaders;
@@ -747,15 +740,9 @@ make_bcc_file (void)
     char *vec[6];
     FILE * in, *out;
 
-#ifdef HAVE_MKSTEMP
     fd = mkstemp(bccfil);
     if (fd == -1 || (out = fdopen(fd, "w")) == NULL)
        adios (bccfil, "unable to create");
-#else
-    mktemp (bccfil);
-    if ((out = fopen (bccfil, "w")) == NULL)
-       adios (bccfil, "unable to create");
-#endif
     chmod (bccfil, 0600);
 
     fprintf (out, "Date: %s\n", dtimenow (0));
diff --git a/uip/viamail.c b/uip/viamail.c
index aea746d..2e1c51c 100644
--- a/uip/viamail.c
+++ b/uip/viamail.c
@@ -18,10 +18,6 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 static struct swit switches[] = {
 #define        TOSW                    0
     { "to mailpath", 0 },

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

Summary of changes:
 config.h         |   15 ---------------
 h/prototypes.h   |    2 --
 sbr/Makefile     |    2 +-
 sbr/lock_file.c  |   10 ----------
 sbr/pidstatus.c  |    4 ----
 sbr/pidwait.c    |   17 -----------------
 uip/mhbuild.c    |    4 ----
 uip/mhbuildsbr.c |    4 ----
 uip/mhcachesbr.c |    4 ----
 uip/mhlist.c     |    4 ----
 uip/mhn.c        |    4 ----
 uip/mhoutsbr.c   |    4 ----
 uip/mhparse.c    |    4 ----
 uip/mhshow.c     |    4 ----
 uip/mhshowsbr.c  |   20 --------------------
 uip/mhstore.c    |    4 ----
 uip/mhtest.c     |    4 ----
 uip/rcvtty.c     |    6 ------
 uip/spost.c      |   13 -------------
 uip/viamail.c    |    4 ----
 20 files changed, 1 insertions(+), 132 deletions(-)


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



reply via email to

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