Use sysexits.h for better exit-codes
[mmh] / sbr / m_draft.c
index e97dd1e..b3659f9 100644 (file)
@@ -9,6 +9,7 @@
 #include <h/mh.h>
 #include <h/utils.h>
 #include <errno.h>
+#include <sysexits.h>
 
 
 /*
@@ -25,7 +26,7 @@ m_draft(char *which)
        folder = getcpy(toabsdir(draftfolder));
        create_folder(folder, 0, exit);
        if (!(mp = folder_read(folder))) {
-               adios(NULL, "unable to read folder %s", folder);
+               adios(EX_IOERR, NULL, "unable to read folder %s", folder);
        }
        free(folder);
 
@@ -37,10 +38,10 @@ m_draft(char *which)
        */
        if (mp->hghmsg >= mp->hghoff) {
                if (!(mp = folder_realloc(mp, 1, mp->hghmsg + 10)))
-                       adios(NULL, "unable to allocate folder storage");
+                       adios(EX_OSERR, NULL, "unable to allocate folder storage");
        } else if (mp->lowoff > 1) {
                if (!(mp = folder_realloc(mp, 1, mp->hghoff)))
-                       adios(NULL, "unable to allocate folder storage");
+                       adios(EX_OSERR, NULL, "unable to allocate folder storage");
        }
 
        mp->msgflags |= ALLOW_BEYOND;  /* allow the beyond sequence */
@@ -51,7 +52,7 @@ m_draft(char *which)
        ** (to start a new draft).
        */
        if (!m_convert(mp, which))
-               exit(1);
+               exit(EX_SOFTWARE);
        seq_setprev(mp);
 
        snprintf(buffer, sizeof(buffer), "%s/%s", mp->foldpath,