]> diplodocus.org Git - nmh/blobdiff - uip/rcvstore.c
inc/test-eom-align: Create test mboxes in less steps.
[nmh] / uip / rcvstore.c
index 25bb8780dd6eb66ae96f7ee0fc39ad6f27966bdc..0238818815b7a47c3307a4a9359507fb2751a107 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * rcvstore.c -- asynchronously add mail to a folder
+/* rcvstore.c -- asynchronously add mail to a folder
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -11,6 +9,11 @@
 #include <fcntl.h>
 #include <h/signals.h>
 #include <h/mts.h>
+#include "h/done.h"
+#include <h/utils.h>
+#include "sbr/m_maildir.h"
+#include "sbr/m_mktemp.h"
+#include "sbr/makedir.h"
 
 #define RCVSTORE_SWITCHES \
     X("create", 0, CRETSW) \
@@ -56,7 +59,7 @@ main (int argc, char **argv)
 
     if (nmh_init(argv[0], 2)) { return 1; }
 
-    done=unlink_done;
+    set_done(unlink_done);
 
     mts_init ();
     arguments = getarguments (invo_name, argc, argv, 1);
@@ -121,8 +124,7 @@ main (int argc, char **argv)
        if (*cp == '+' || *cp == '@') {
            if (folder)
                adios (NULL, "only one folder at a time!");
-           else
-               folder = pluspath (cp);
+            folder = pluspath (cp);
        } else {
            adios (NULL, "usage: %s [+folder] [switches]", invo_name);
        }
@@ -175,7 +177,7 @@ main (int argc, char **argv)
     /* don't add file if it is empty */
     if (st.st_size == 0) {
        (void) m_unlink (tmpfilenam);
-       advise (NULL, "empty file");
+       inform("empty file");
        done (0);
     }
 
@@ -222,7 +224,7 @@ main (int argc, char **argv)
 /*
  * Clean up and exit
  */
-static void
+static void NORETURN
 unlink_done(int status)
 {
     if (tmpfilenam && *tmpfilenam)