Wrapped setjmp(), sigsetjmp(), and vfork() calls to silence gcc -Wclobbered for good...
[mmh] / uip / mhparse.c
index d40d78c..265276d 100644 (file)
@@ -12,7 +12,6 @@
 #include <h/signals.h>
 #include <h/md5.h>
 #include <errno.h>
-#include <setjmp.h>
 #include <signal.h>
 #include <h/mts.h>
 #include <h/tws.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
 
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
 
 extern int debugsw;
 
@@ -1046,6 +1041,8 @@ invalid:
 static int
 InitGeneric (CT ct)
 {
+    NMH_UNUSED (ct);
+
     return OK;         /* not much to do here */
 }
 
@@ -2489,10 +2486,8 @@ openFTP (CT ct, char **file)
     if ((ftp = context_find (nmhaccessftp)) && !*ftp)
        ftp = NULL;
 
-#ifndef BUILTIN_FTP
     if (!ftp)
        return NOTOK;
-#endif
 
     switch (openExternal (e->eb_parent, e->eb_content, ce, file, &fd)) {
        case NOTOK:
@@ -2591,9 +2586,6 @@ openFTP (CT ct, char **file)
        return NOTOK;
     }
 
-#ifdef BUILTIN_FTP
-    if (ftp)
-#endif
     {
        int child_id, i, vecp;
        char *vec[9];
@@ -2612,7 +2604,7 @@ openFTP (CT ct, char **file)
 
        fflush (stdout);
 
-       for (i = 0; (child_id = vfork ()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
            sleep (5);
        switch (child_id) {
            case NOTOK:
@@ -2629,9 +2621,6 @@ openFTP (CT ct, char **file)
 
            default:
                if (pidXwait (child_id, NULL)) {
-#ifdef BUILTIN_FTP
-losing_ftp:
-#endif
                    username = password = NULL;
                    ce->ce_unlink = 1;
                    return NOTOK;
@@ -2639,14 +2628,6 @@ losing_ftp:
                break;
        }
     }
-#ifdef BUILTIN_FTP
-    else
-       if (ftp_get (e->eb_site, user, pass, e->eb_dir, e->eb_name,
-                    ce->ce_file,
-                    e->eb_mode && !mh_strcasecmp (e->eb_mode, "ascii"), 0)
-               == NOTOK)
-           goto losing_ftp;
-#endif
 
     if (cachefile[0]) {
        if (caching)
@@ -2765,7 +2746,7 @@ openMail (CT ct, char **file)
     vec[vecp++] = e->eb_body;
     vec[vecp] = NULL;
 
-    for (i = 0; (child_id = vfork ()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = m_vfork()) == NOTOK && i < 5; i++)
        sleep (5);
     switch (child_id) {
        case NOTOK: