Lots of little code cleanups to prevent warnings - mostly making sure
[mmh] / uip / rcvtty.c
index b847b56..f922012 100644 (file)
@@ -10,6 +10,7 @@
 #include <h/rcvmail.h>
 #include <h/scansbr.h>
 #include <zotnet/tws/tws.h>
+#include <zotnet/mts/mts.h>
 #include <signal.h>
 #include <fcntl.h>
 
@@ -191,13 +192,13 @@ message_fd (char **vec)
     struct stat st;
 
 #ifdef HAVE_MKSTEMP
-    unlink (mkstemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil))));
+    fd = mkstemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil)));
 #else
     unlink (mktemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil))));
-#endif
     if ((fd = open (tmpfil, O_RDWR | O_CREAT | O_TRUNC, 0600)) == NOTOK)
        return header_fd ();
     unlink (tmpfil);
+#endif
 
     if ((child_id = vfork()) == NOTOK) {
        /* fork error */