]> git.marmaro.de Git - mmh/commitdiff
Well the wrap of vfork() calls didn't work: its semantics don't allow that. So...
authorDavid Levine <levinedl@acm.org>
Tue, 17 Jan 2012 23:33:29 +0000 (17:33 -0600)
committerDavid Levine <levinedl@acm.org>
Tue, 17 Jan 2012 23:33:29 +0000 (17:33 -0600)
18 files changed:
configure.ac
h/prototypes.h
sbr/Makefile.in
sbr/ext_hook.c
sbr/folder_delmsgs.c
sbr/m_vfork.c [deleted file]
sbr/makedir.c
sbr/refile.c
sbr/showfile.c
uip/mhbuildsbr.c
uip/mhlsbr.c
uip/mhparse.c
uip/mhshowsbr.c
uip/rcvtty.c
uip/replsbr.c
uip/sendsbr.c
uip/spost.c
uip/whatnowsbr.c

index 4f3d260f9b34c2512998a4c46614133f78a287ef..707322cdafd56f5f198e53c81ba2bc580b264c6e 100644 (file)
@@ -236,8 +236,8 @@ AC_SUBST(DISABLE_UNUSED_MACROS_WARNING)dnl
 
 AC_CACHE_CHECK(whether compiler supports -Wextra, nmh_cv_wextra,
 [nmh_saved_cflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wextra"
- AC_TRY_COMPILE([],[],nmh_cv_wextra=' -Wextra',echo -n no)
+ CFLAGS="$CFLAGS -Wextra -Wno-clobbered"
+ AC_TRY_COMPILE([],[],nmh_cv_wextra=' -Wextra -Wno-clobbered',echo -n no)
  CFLAGS="$nmh_saved_cflags"])
 
 AC_CACHE_CHECK(whether compiler supports -Wno-pointer-sign, nmh_cv_has_noptrsign,
index 054430646dd9a13ef3f5007f35c85c5e4729d68d..12124cdbad0b43797c00572fdf48346f37ac9a23 100644 (file)
@@ -80,7 +80,6 @@ int m_putenv (char *, char *);
 char *m_mktemp(const char *, int *, FILE **);
 char *m_mktemp2(const char *, const char *, int *, FILE **);
 void m_unknown(FILE *);
-pid_t m_vfork ();
 int makedir (char *);
 char *nmh_getpass(const char *);
 char *norm_charmap(char *);
index c65828bb2980fda1d59981495737e7bfcb0fac52..f5f7414fabd76faee281bde08bc399cd2ead4757 100644 (file)
@@ -62,7 +62,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_setjmp.c m_vfork.c                       \
+       m_maildir.c m_name.c m_setjmp.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                  \
index 506457d210b45b8c4c3d01bb6b601bbbac3961ee..e94083b337f73508fb343c9633ea832d67114e4d 100644 (file)
@@ -23,7 +23,7 @@ ext_hook(char *hook_name, char *message_file_name_1, char *message_file_name_2)
     if ((hook = context_find(hook_name)) == (char *)0)
        return (OK);
 
-    switch (pid = m_vfork()) {
+    switch (pid = vfork()) {
     case -1:
        status = NOTOK;
        advise(NULL, "external database may be out-of-date.");
index b812def1a6eedce82cddf05e704fe9a56084b3a4..6bde76f9349b2c97a5cc5d43166404296cc78e13 100644 (file)
@@ -57,7 +57,7 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook)
        fflush (stdout);
        vec[0] = r1bindex (rmmproc, '/');
 
-       switch (pid = m_vfork()) {
+       switch (pid = vfork()) {
        case -1:
            advise ("fork", "unable to");
            return -1;
diff --git a/sbr/m_vfork.c b/sbr/m_vfork.c
deleted file mode 100644 (file)
index e35f0bc..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-/*
- * m_vfork.c -- Wraps vfork(), to help prevent warnings about arguments
- *           -- and variables that might be clobbered by a vfork call
- *           -- with gcc -Wclobbered.
- *
- * This code is Copyright (c) 2012, by the authors of nmh.  See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
-
-#include <h/mh.h>
-
-pid_t
-m_vfork() {
-  return vfork();
-}
index bbeef80b1db3414a4fa9c1df5168ee611b3b1d0f..4337b7cea06b252a6336bfc6765daedd41632238 100644 (file)
@@ -85,7 +85,7 @@ makedir (char *dir)
           nested directories like the above code can.
 
           -- Dan Harkless <dan-nmh@dilvish.speed.net> */
-       switch (pid = m_vfork()) {
+       switch (pid = vfork()) {
            case -1: 
                advise ("fork", "unable to");
                return 0;
index a2a958ddb19261a41ba49e361779dac6a29c4e1d..fc2793c699dae5ee05836982305ff4f2ed8f1516 100644 (file)
@@ -34,7 +34,7 @@ refile (char **arg, char *file)
     context_save();    /* save the context file */
     fflush(stdout);
 
-    switch (pid = m_vfork()) {
+    switch (pid = vfork()) {
        case -1: 
            advise ("fork", "unable to");
            return -1;
index 17f84b9c98b519f36248b28771a89125581807e8..59ae7952b2b6f2cc61858b7231d9962492691845 100644 (file)
@@ -28,7 +28,7 @@ showfile (char **arg, char *file)
     if (!strcmp (r1bindex (lproc, '/'), "mhl"))
        lproc = mhlproc;
 
-    switch (pid = m_vfork()) {
+    switch (pid = vfork()) {
     case -1:
        /* fork error */
        advise ("fork", "unable to");
index d417befde88f6ac826a31ca7ed6e17acb1089a0e..2a3f8996958826121cb1ba349a05c37645579e27 100644 (file)
@@ -1087,7 +1087,7 @@ raw:
            if ((out = fopen (ce->ce_file, "w")) == NULL)
                adios (ce->ce_file, "unable to open for writing");
 
-           for (i = 0; (child_id = m_vfork()) == NOTOK && i > 5; i++)
+           for (i = 0; (child_id = vfork()) == NOTOK && i > 5; i++)
                sleep (5);
            switch (child_id) {
            case NOTOK:
index b49481285488bb5aa3424a6da6a0014987b9e0cb..6335463f4447167ff4dbf128a4aaea1f0f2bacca 100644 (file)
@@ -1587,7 +1587,7 @@ doface (struct mcomp *c1)
        return NOTOK;
     }
 
-    for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
        sleep (5);
 
     switch (child_id) {
@@ -1761,7 +1761,7 @@ m_popen (char *name)
     if (pipe (pd) == NOTOK)
        adios ("pipe", "unable to");
 
-    switch (m_pid = m_vfork()) {
+    switch (m_pid = vfork()) {
        case NOTOK: 
            adios ("fork", "unable to");
 
index 265276ddba112746f8a35fedaab98ea1dbcd5161..e151062c488236a3c8c497fc7b2cd231e3587d55 100644 (file)
@@ -2604,7 +2604,7 @@ openFTP (CT ct, char **file)
 
        fflush (stdout);
 
-       for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
            sleep (5);
        switch (child_id) {
            case NOTOK:
@@ -2746,7 +2746,7 @@ openMail (CT ct, char **file)
     vec[vecp++] = e->eb_body;
     vec[vecp] = NULL;
 
-    for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
        sleep (5);
     switch (child_id) {
        case NOTOK:
index ae90a7b524c12d7bd9a230b0b82c4cbc8e7366d9..c60acb9d88980ba119ae5a591efaafa18ffd3158 100644 (file)
@@ -197,7 +197,7 @@ DisplayMsgHeader (CT ct, char *form)
 
     fflush (stdout);
 
-    for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
        sleep (5);
 
     switch (child_id) {
@@ -564,7 +564,7 @@ show_content_aux2 (CT ct, int serial, int alternate, char *cracked, char *buffer
 
     fflush (stdout);
 
-    for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
        sleep (5);
     switch (child_id) {
        case NOTOK:
index 8e659ffe0c05854af36a8633914c04e8c01e4954..f61f0b983192a899db91e3ffd86f21b78e0bbdc9 100644 (file)
@@ -192,7 +192,7 @@ message_fd (char **vec)
     fd = mkstemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil)));
     unlink (tmpfil);
 
-    if ((child_id = m_vfork()) == NOTOK) {
+    if ((child_id = vfork()) == NOTOK) {
        /* fork error */
        close (fd);
        return header_fd ();
index 7365b45e0512ed484d547329ad7a610673cf8d11..e2f63c578a8676e116b2b6a955556b3c334bfa45 100644 (file)
@@ -466,7 +466,7 @@ replfilter (FILE *in, FILE *out, char *filter)
     rewind (in);
     lseek (fileno(in), (off_t) 0, SEEK_SET);
 
-    switch (pid = m_vfork()) {
+    switch (pid = vfork()) {
        case NOTOK: 
            adios ("fork", "unable to");
 
index 63efbc0ae02244942cf55d4baaf74eefff8d5866..f216e952df88016a4ecbb2b100f169f29777bb02 100644 (file)
@@ -794,7 +794,7 @@ sendaux (char **vec, int vecp, char *drft, struct stat *st)
        done (1);
     vec[vecp] = NULL;
 
-    for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
        sleep (5);
 
     switch (child_id) {
index 6defbacc164962317ec8901189b7201e79b9b6c5..187f9a0e3b38a474a6bdca68846f5e8a658a8f8d 100644 (file)
@@ -428,7 +428,7 @@ main (int argc, char **argv)
 
     if (pushflg && !(watch || verbose)) {
        /* fork to a child to run sendmail */
-       for (i=0; (pid = m_vfork()) == NOTOK && i < 5; i++)
+       for (i=0; (pid = vfork()) == NOTOK && i < 5; i++)
            sleep(5);
        switch (pid) {
            case NOTOK:
@@ -764,7 +764,7 @@ make_bcc_file (void)
     else {
        vec[0] = r1bindex (mhlproc, '/');
 
-       for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
            sleep (5);
        switch (child_id) {
            case NOTOK: 
@@ -825,7 +825,7 @@ fcc (char *file, char *folder)
        printf ("%sFcc: %s\n", msgstate == resent ? "Resent-" : "", folder);
     fflush (stdout);
 
-    for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
        sleep (5);
     switch (child_id) {
        case NOTOK: 
index 85c50b3f56365122543a4090e2e44f35b0050dd9..36ba346d1c4b59a2245aece5e3dfe92f2eca3227 100644 (file)
@@ -696,7 +696,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp,
     context_save ();   /* save the context file */
     fflush (stdout);
 
-    switch (pid = m_vfork()) {
+    switch (pid = vfork()) {
        case NOTOK:
            advise ("fork", "unable to");
            status = NOTOK;
@@ -846,7 +846,7 @@ sendfile (char **arg, char *file, int pushsw)
     context_save ();   /* save the context file */
     fflush (stdout);
 
-    for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
        sleep (5);
     switch (child_id) {
        case NOTOK:
@@ -1349,7 +1349,7 @@ whomfile (char **arg, char *file)
     context_save ();   /* save the context file */
     fflush (stdout);
 
-    switch (pid = m_vfork()) {
+    switch (pid = vfork()) {
        case NOTOK:
            advise ("fork", "unable to");
            return 1;