Removed HAVE_STRUCT_TM_TM_GMTOFF support because it didn't work on Cygwin and isn...
[mmh] / uip / sendsbr.c
index 57ef007..09126c2 100644 (file)
 #include <h/tws.h>
 #include <h/utils.h>
 
-#ifdef TIME_WITH_SYS_TIME
+#ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
-# include <time.h>
-#else
-# ifdef TM_IN_SYS_TIME
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
 #endif
+#include <time.h>
 
 int debugsw = 0;               /* global */
 int forwsw  = 1;
@@ -500,9 +494,10 @@ make_mime_composition_file_entry(char *file_name, int attachformat)
                least. */
             (void) fprintf (composition_file, "#%s <>", content_type);
         } else {
-            /* Suppress Content-Id, insert simple Content-Disposition. */
+            /* Suppress Content-Id, insert simple Content-Disposition
+               and Content-Description with filename. */
             (void) fprintf (composition_file,
-                            "#%s; name=\"%s\" <>{attachment}",
+                            "#%1$s; name=\"%2$s\" <> [%2$s]{attachment}",
                             content_type,
                             ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1);
         }
@@ -517,9 +512,9 @@ make_mime_composition_file_entry(char *file_name, int attachformat)
             (void) fprintf (composition_file, "#%s <>", content_type);
         } else {
             /* Suppress Content-Id, insert Content-Disposition with
-               modification date. */
+               modification date and Content-Description wtih filename. */
             (void) fprintf (composition_file,
-                            "#%s; name=\"%s\" <>{attachment; modification-date=\"%s\"}",
+                            "#%1$s; name=\"%2$s\" <>[%2$s]{attachment; modification-date=\"%3$s\"}",
                             content_type,
                             ((p = strrchr(file_name, '/')) == (char *)0) ? file_name : p + 1,
                             dtime (&st.st_mtime, 0));
@@ -776,10 +771,11 @@ splitmsg (char **vec, int vecp, char *drft, struct stat *st, int delay)
  */
 
 static int
-sendaux (char **vec, int vecp, char *drft, struct stat *st)
+sendaux (char **vec, int vecp, char *volatile drft, struct stat *st)
 {
     pid_t child_id;
-    int i, status, fd, fd2;
+    int i, status;
+    volatile int fd, fd2;
     char backup[BUFSIZ], buf[BUFSIZ];
 
     fd = pushsw ? tmp_fd () : NOTOK;
@@ -976,14 +972,14 @@ anno (int fd, struct stat *st)
            sigaddset (&set, SIGINT);
            sigaddset (&set, SIGQUIT);
            sigaddset (&set, SIGTERM);
-           SIGPROCMASK (SIG_BLOCK, &set, &oset);
+           sigprocmask (SIG_BLOCK, &set, &oset);
 
            annoaux (fd);
            if (child_id == OK)
                _exit (0);
 
            /* reset the signal mask */
-           SIGPROCMASK (SIG_SETMASK, &oset, &set);
+           sigprocmask (SIG_SETMASK, &oset, &set);
 
            chdir (cwd);
            break;