]> diplodocus.org Git - nmh/commitdiff
Add code for (and convert world to) the new world lock order.
authorKen Hornstein <kenh@pobox.com>
Mon, 18 Mar 2013 19:29:35 +0000 (15:29 -0400)
committerKen Hornstein <kenh@pobox.com>
Mon, 18 Mar 2013 19:29:35 +0000 (15:29 -0400)
Still need to add some code to make inc and pick behave better (not hold locks
for as long).

37 files changed:
h/mh.h
h/prototypes.h
sbr/folder_free.c
sbr/folder_read.c
sbr/m_draft.c
sbr/seq_read.c
sbr/seq_save.c
uip/anno.c
uip/burst.c
uip/comp.c
uip/dist.c
uip/flist.c
uip/fmttest.c
uip/folder.c
uip/forw.c
uip/inc.c
uip/mark.c
uip/mhbuildsbr.c
uip/mhlist.c
uip/mhn.c
uip/mhpath.c
uip/mhshow.c
uip/mhstore.c
uip/mhstoresbr.c
uip/mhtest.c
uip/msh.c
uip/packf.c
uip/pick.c
uip/rcvstore.c
uip/refile.c
uip/repl.c
uip/rmm.c
uip/scan.c
uip/send.c
uip/sendsbr.c
uip/show.c
uip/sortm.c

diff --git a/h/mh.h b/h/mh.h
index daf47c02d042498a26ff93311808154e67322c14..c5246f29e0afdb4a5ae5e54f13e87af24e823297 100644 (file)
--- a/h/mh.h
+++ b/h/mh.h
@@ -205,6 +205,18 @@ struct msgs {
      * in a particular sequence.
      */
     seqset_t *msgstats;                /* msg status */
+
+    /*
+     * A FILE handle containing an open filehandle for the sequence file
+     * for this folder.  If non-NULL, use it when the sequence file is
+     * written.
+     */
+    FILE *seqhandle;
+
+    /*
+     * The name of the public sequence file; required by lkfclose()
+     */
+    char *seqname;
 };
 
 /*
index 14b1252824fc3bffd8bf670549ca621152737aca..484bef28648bcc48c578015c437bd631d18418e0 100644 (file)
@@ -66,7 +66,19 @@ int folder_addmsg (struct msgs **, char *, int, int, int, int, char *);
 int folder_delmsgs (struct msgs *, int, int);
 void folder_free (struct msgs *);
 int folder_pack (struct msgs **, int);
-struct msgs *folder_read (char *);
+
+/*
+ * Read a MH folder structure and return an allocated "struct msgs"
+ * corresponding to the contents of the folder.
+ *
+ * Arguments include:
+ *
+ * name                - Name of folder
+ * lockflag    - If true, write-lock (and keep open) metadata files.
+ *               See comments for seq_read() for more information.
+ */
+struct msgs *folder_read (char *name, int lockflag);
+
 struct msgs *folder_realloc (struct msgs *, int, int);
 int gans (char *, struct swit *);
 char **getans (char *, struct swit *);
@@ -152,7 +164,21 @@ char *seq_list (struct msgs *, char *);
 int seq_nameok (char *);
 void seq_print (struct msgs *, char *);
 void seq_printall (struct msgs *);
-void seq_read (struct msgs *);
+
+/*
+ * Read the sequence files for the folder referenced in the given
+ * struct msgs and populate the sequence entries in the struct msgs.
+ *
+ * Arguments:
+ *
+ * mp          - Folder structure to add sequence entries to
+ * lockflag    - If true, obtain a write lock on the sequence file.
+ *               Additionally, the sequence file will remain open
+ *               and a pointer to the filehandle will be stored in
+ *               folder structure, where it will later be used by
+ *               seq_save().
+ */
+void seq_read (struct msgs * mp, int lockflag);
 void seq_save (struct msgs *);
 void seq_setcur (struct msgs *, int);
 void seq_setprev (struct msgs *);
index ebb58ab46bbb1d8d65b006443ea56c0009cce0bf..7f87ccd4f406a2ff1e8bea13c6f0ba2797286c0b 100644 (file)
@@ -25,6 +25,14 @@ folder_free (struct msgs *mp)
     for (i = 0; mp->msgattrs[i]; i++)
        free (mp->msgattrs[i]);
 
+    /* Close/free the sequence file if it is open */
+
+    if (mp->seqhandle)
+       lkfclosedata (mp->seqhandle, mp->seqname);
+
+    if (mp->seqname)
+       free (mp->seqname);
+
     free (mp->msgstats);       /* free message status area   */
     free (mp);                 /* free main folder structure */
 }
index 292044841ba529fca0bee02349f67f3fa7f529f9..02271bc6b4531082fc16d0b0e469039d349b24c8 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 struct msgs *
-folder_read (char *name)
+folder_read (char *name, int lockflag)
 {
     int msgnum, prefix_len, len, *mi;
     struct msgs *mp;
@@ -54,6 +54,8 @@ folder_read (char *name)
     mp->hghsel = 0;
     mp->numsel = 0;
     mp->nummsg = 0;
+    mp->seqhandle = NULL;
+    mp->seqname = NULL;
 
     if (access (name, W_OK) == -1)
        set_readonly (mp);
@@ -151,7 +153,7 @@ folder_read (char *name)
     /*
      * Read and initialize the sequence information.
      */
-    seq_read (mp);
+    seq_read (mp, lockflag);
 
     return mp;
 }
index e47918693c1b334afa67036d57cccb683a8107fe..a8c973d214c3acd8d2ded104c49bd11351c29797 100644 (file)
@@ -38,7 +38,7 @@ m_draft (char *folder, char *msg, int use, int *isdf)
     if (chdir (buffer) == -1)
        adios (buffer, "unable to change directory to");
 
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /*
index 2bea5367b8d1a68f9d4ef71910653a4bb5ad448e..eea27512fb6841fdbe0159255b283bd8301ce0b9 100644 (file)
@@ -15,7 +15,7 @@
  * static prototypes
  */
 static int seq_init (struct msgs *, char *, char *);
-static void seq_public (struct msgs *);
+static void seq_public (struct msgs *, int);
 static void seq_private (struct msgs *);
 
 
@@ -26,7 +26,7 @@ static void seq_private (struct msgs *);
  */
 
 void
-seq_read (struct msgs *mp)
+seq_read (struct msgs *mp, int lockflag)
 {
     /*
      * Initialize the list of sequence names.  Go ahead and
@@ -41,7 +41,7 @@ seq_read (struct msgs *mp)
        return;
 
     /* Initialize the public sequences */
-    seq_public (mp);
+    seq_public (mp, lockflag);
 
     /* Initialize the private sequences */
     seq_private (mp);
@@ -53,7 +53,7 @@ seq_read (struct msgs *mp)
  */
 
 static void
-seq_public (struct msgs *mp)
+seq_public (struct msgs *mp, int lockflag)
 {
     int state;
     char *cp, seqfile[PATH_MAX];
@@ -73,7 +73,7 @@ seq_public (struct msgs *mp)
     /* get filename of sequence file */
     snprintf (seqfile, sizeof(seqfile), "%s/%s", mp->foldpath, mh_seq);
 
-    if ((fp = lkfopendata (seqfile, "r")) == NULL)
+    if ((fp = lkfopendata (seqfile, lockflag ? "r+" : "r")) == NULL)
        return;
 
     /* Use m_getfld to scan sequence file */
@@ -96,7 +96,8 @@ seq_public (struct msgs *mp)
                }
                continue;
 
-           case BODY: 
+           case BODY:
+               lkfclosedata (fp, seqfile);
                adios (NULL, "no blank lines are permitted in %s", seqfile);
                /* fall */
 
@@ -104,13 +105,19 @@ seq_public (struct msgs *mp)
                break;
 
            default: 
+               lkfclosedata (fp, seqfile);
                adios (NULL, "%s is poorly formatted", seqfile);
        }
        break;  /* break from for loop */
     }
     m_getfld_state_destroy (&gstate);
 
-    lkfclosedata (fp, seqfile);
+    if (lockflag) {
+       mp->seqhandle = fp;
+       mp->seqname = getcpy(seqfile);
+    } else {
+       lkfclosedata (fp, seqfile);
+    }
 }
 
 
index 837b4bab4147c0ebd88fe0e4a291df90b328af0d..3c53e4bc1914678638db8e545acffe281981af9b 100644 (file)
@@ -30,8 +30,11 @@ seq_save (struct msgs *mp)
     sigset_t set, oset;
 
     /* check if sequence information has changed */
-    if (!(mp->msgflags & SEQMOD))
+    if (!(mp->msgflags & SEQMOD)) {
+       if (mp->seqhandle)
+           lkfclosedata (mp->seqhandle, mp->seqname);
        return;
+    }
     mp->msgflags &= ~SEQMOD;
 
     fp = NULL;
@@ -74,7 +77,15 @@ priv:
                 * If that fails (probably because folder is
                 * readonly), then make sequence private.
                 */
-               if ((fp = lkfopendata (seqfile, "w")) == NULL
+
+               if (mp->seqhandle) {
+                   fp = mp->seqhandle;
+                   mp->seqhandle = NULL;
+                   free(mp->seqname);
+                   mp->seqname = NULL;
+                   rewind(fp);
+                   ftruncate(fileno(fp), 0);
+               } else if ((fp = lkfopendata (seqfile, "w")) == NULL
                        && (unlink (seqfile) == -1 ||
                            (fp = lkfopendata (seqfile, "w")) == NULL)) {
                    admonish (attr, "unable to write");
index cf52021c61936403078420f239201ec6a177ae19..d18713ae668a3c16f9ff334b201936bee291fdc2 100644 (file)
@@ -240,7 +240,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index e4792335f4d3f5bd2906cbc16d92efb82591e001..34ef10b024d6e883b3fc6473ad27a49e14e85e1f 100644 (file)
@@ -158,7 +158,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 416a8854ced713dff4a5fbc514f7a527385670fa..be7968d1146f428d3846f5a60eee94a58739218e 100644 (file)
@@ -256,7 +256,7 @@ main (int argc, char **argv)
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 1)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
@@ -267,6 +267,7 @@ main (int argc, char **argv)
        if (!m_convert (mp, msg))
            done (1);
        seq_setprev (mp);       /* set the previous-sequence */
+       seq_save (mp);
 
        if (mp->numsel > 1)
            adios (NULL, "only one message at a time!");
index 3d247181b5c9c50f03faefc9ef7f6a768407f461..d3ceaec25a480e4cf591570a0b8b9b086198892b 100644 (file)
@@ -281,7 +281,7 @@ try_it_again:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 1)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index 1444acaf2316d4b42bca4cddc3ffd39894356eb9..d0945fce76958ca60d9fdeb894f42ad207a4bf69 100644 (file)
@@ -468,7 +468,7 @@ AddFolder(char *name, int force)
     struct msgs *mp;
 
     /* Read folder and create message structure */
-    if (!(mp = folder_read (name))) {
+    if (!(mp = folder_read (name, 0))) {
        /* Oops, error occurred.  Record it and continue. */
        AllocFolders(&folders, &nFoldersAlloced, nFolders + 1);
        f = &folders[nFolders++];
index dafdbdb8929e4877a73d94b00c753b8889ee338d..8b81924b8ca22e176e2b433aaec512b4589ea8a1 100644 (file)
@@ -507,7 +507,7 @@ process_messages(struct format *fmt, struct msgs_array *comps,
     if (chdir(maildir) < 0)
        adios(maildir, "unable to change directory to");
 
-    if (!(mp = folder_read(folder)))
+    if (!(mp = folder_read(folder, 1)))
        adios(NULL, "unable to read folder %s", folder);
 
     if (mp->nummsg == 0)
index e4defc70552a79d3318b5a73442019b2701e1e27..29ef616abfa1324175ab32577ff704cff0d3c293 100644 (file)
@@ -403,7 +403,7 @@ get_folder_info_body (char *fold, char *msg, boolean *crawl_children)
        /*
         * create message structure and get folder info
         */
-       if (!(mp = folder_read (fold))) {
+       if (!(mp = folder_read (fold, 1))) {
            admonish (NULL, "unable to read folder %s", fold);
            return 0;
        }
index 18a4f03bf2ded18e82a707241d1fee7cc3c94eb4..45fb740f771c1276e2a6d151cbaca6794ee2b4f5 100644 (file)
@@ -363,7 +363,7 @@ try_it_again:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 1)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index 6f7f5946716bcc72023f7cf488dad192eced16bd..2b4c7ce9984a67d24d147ecbbd1c5b6e27f0c3d5 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -515,7 +515,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 0)))
        adios (NULL, "unable to read folder %s", folder);
 
 go_to_it:
index f99832a2c76847fa64ad7b38aea5909b5d191dd2..cc5a7133b4e36cc4a2406269b5b3a9d4727aaa7a 100644 (file)
@@ -159,7 +159,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* print some general debugging info */
index 8bac6d37c477c41c67a449fbe997bd4bc026ae8d..459a25597fdd64a950eddec4cd4aae923dea151b 100644 (file)
@@ -753,7 +753,7 @@ use_forw:
        if (!folder)
            folder = add (getfolder (1), NULL);
 
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 0)))
            adios (NULL, "unable to read folder %s", folder);
        for (ap = arguments; *ap; ap++) {
            cp = *ap;
index 6ab50e399f24ec7312313827b42ae900e8402542..38060739de2d2ed6174817461efeab8f697b7d76 100644 (file)
@@ -278,7 +278,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 0)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index a5a7b05ed7f87371b2788cd78ac25a291321757d..ced10f2e709d0a543f08a269b0f790b62f795d8a 100644 (file)
--- a/uip/mhn.c
+++ b/uip/mhn.c
@@ -512,7 +512,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 1)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index ef16bce2025c1b72358e024e81b5ba2884d88799..3a0a628b6f1e522d387885ee0be5803a8cc72e9d 100644 (file)
@@ -91,7 +91,7 @@ main(int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /*
index f5666b072397bf5e1537bd6cb34b9b59bbcc55f5..76a0d022d959de2f786c94aff95f7a4cbb904d7b 100644 (file)
@@ -336,7 +336,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 1)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index 1865f14c02f8c9b76eecd843dbfedf77dd721068..cd84aeefd29b1576450c10b006567339b29bf0d6 100644 (file)
@@ -304,7 +304,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 1)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index b978dbfb3c304f7c262dc4f50aa9f6c9b9c7a4f4..6badafeb9ffcbf2454dedc71d40a61506919fd3d 100644 (file)
@@ -872,7 +872,7 @@ output_content_folder (char *folder, char *filename)
     struct msgs *mp;
 
     /* Read the folder. */
-    if ((mp = folder_read (folder))) {
+    if ((mp = folder_read (folder, 0))) {
        /* Link file into folder */
        msgnum = folder_addmsg (&mp, filename, 0, 0, 0, 0, (char *)0);
     } else {
index cf7f8642419520b91196e71b4a7b5d95cae31ce3..aa6d8e43568206496f6db9e5a603f82bc8c1709e 100644 (file)
@@ -270,7 +270,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 1)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index 2a562f007a0e359a461629496c1489252aa57dfd..c1f0fc3aeac053faaae61b14a67c2b2604f55118 100644 (file)
--- a/uip/msh.c
+++ b/uip/msh.c
@@ -604,7 +604,7 @@ fsetup (char *folder)
        padios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 0)))
        padios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
@@ -831,7 +831,7 @@ check_folder (int scansw)
        low = mp->hghmsg + 1;
        folder_free (mp);               /* free folder/message structure */
 
-       if (!(mp = folder_read (fmsh)))
+       if (!(mp = folder_read (fmsh, 0)))
            padios (NULL, "unable to re-read folder %s", fmsh);
 
        hgh = mp->hghmsg;
index 53e696afb78f69233a72311b9e1cf8f6c5ee84b8..d82ef78264d6c21c8316c06df240683845ec27d8 100644 (file)
@@ -138,7 +138,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to ");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 5549ea64ac24eb88dffc4bf50d515fdc84c9bda1..281a1ac7cf081a3a4a68cf8c965e6b6a4216d5dc 100644 (file)
@@ -193,7 +193,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 0)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 3afe12e3dcd789f82e0f248d1f8a1a50d78fa90d..9a89230e2d21900c504515a6d48100e0fe71055b 100644 (file)
@@ -193,7 +193,7 @@ main (int argc, char **argv)
     /*
      * read folder and create message structure
      */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /*
index 54b6e5f8620aeedcd58c74e74331529acfd00357..8dd04fb92a46355de6c6ae280f243f9d03eaf31f 100644 (file)
@@ -195,7 +195,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read source folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
@@ -282,7 +282,7 @@ opnfolds (struct st_fold *folders, int nfolders)
 
        if (chdir (nmaildir) == NOTOK)
            adios (nmaildir, "unable to change directory to");
-       if (!(mp = folder_read (fp->f_name)))
+       if (!(mp = folder_read (fp->f_name, 1)))
            adios (NULL, "unable to read folder %s", fp->f_name);
        mp->curmsg = 0;
 
index e8d64907cdb63bea01eb583524cc69545bdff2ee..840b762069beed0a145b2948b053e3875f9dfd07 100644 (file)
@@ -386,7 +386,7 @@ try_it_again:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (folder)))
+       if (!(mp = folder_read (folder, 1)))
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index d96622ed835c3492546098874d38a303c462bd26..02a55910ba1a95e15034ad80f8b76e7ea3b75554 100644 (file)
--- a/uip/rmm.c
+++ b/uip/rmm.c
@@ -94,7 +94,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 459fcb0730b38ee602d8b967e6e0498f4d2b0659..2996a2b5fc7bb2c86cdcc8ec41b042dd41b506c9 100644 (file)
@@ -201,7 +201,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 510047a0de293da44a51fdf7b49e6e3f7037a8ca..8a6592221c03febf03e3fd91f894a34c9b7617d0 100644 (file)
@@ -350,7 +350,7 @@ main (int argc, char **argv)
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
-       if (!(mp = folder_read (dfolder)))
+       if (!(mp = folder_read (dfolder, 1)))
            adios (NULL, "unable to read folder %s", dfolder);
 
        /* check for empty folder */
index e3a8195f01ed10a189b384fefed794a73f98d173..2a5ad8294fc2187bab0e54d85a85acda94120bc1 100644 (file)
@@ -1064,7 +1064,7 @@ annoaux (int fd)
            admonish (maildir, "unable to change directory to");
        return;
     }
-    if (!(mp = folder_read (folder))) {
+    if (!(mp = folder_read (folder, 0))) {
        if (debugsw)
            admonish (NULL, "unable to read folder %s", folder);
        return;
index dc4261300d1a5e1a91af6b1aa9715d08664a3150..b73e56a8fa83d6b5b990026a99c7648d2cce9e96 100644 (file)
@@ -221,7 +221,7 @@ usage:
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 6e7a74919cf362d7bfd5144a75d48baac291250a..ea6b805ee0bcf9bf8792abbc6fc1ab74ea8be893 100644 (file)
@@ -199,7 +199,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
-    if (!(mp = folder_read (folder)))
+    if (!(mp = folder_read (folder, 1)))
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */