]> 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 daf47c0..c5246f2 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 */
      * 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 14b1252..484bef2 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);
 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 *);
 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 *);
 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 *);
 void seq_save (struct msgs *);
 void seq_setcur (struct msgs *, int);
 void seq_setprev (struct msgs *);
index ebb58ab..7f87ccd 100644 (file)
@@ -25,6 +25,14 @@ folder_free (struct msgs *mp)
     for (i = 0; mp->msgattrs[i]; i++)
        free (mp->msgattrs[i]);
 
     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 */
 }
     free (mp->msgstats);       /* free message status area   */
     free (mp);                 /* free main folder structure */
 }
index 2920448..02271bc 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 struct msgs *
  */
 
 struct msgs *
-folder_read (char *name)
+folder_read (char *name, int lockflag)
 {
     int msgnum, prefix_len, len, *mi;
     struct msgs *mp;
 {
     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->hghsel = 0;
     mp->numsel = 0;
     mp->nummsg = 0;
+    mp->seqhandle = NULL;
+    mp->seqname = NULL;
 
     if (access (name, W_OK) == -1)
        set_readonly (mp);
 
     if (access (name, W_OK) == -1)
        set_readonly (mp);
@@ -151,7 +153,7 @@ folder_read (char *name)
     /*
      * Read and initialize the sequence information.
      */
     /*
      * Read and initialize the sequence information.
      */
-    seq_read (mp);
+    seq_read (mp, lockflag);
 
     return mp;
 }
 
     return mp;
 }
index e479186..a8c973d 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 (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);
 
     /*
        adios (NULL, "unable to read folder %s", folder);
 
     /*
index 2bea536..eea2751 100644 (file)
@@ -15,7 +15,7 @@
  * static prototypes
  */
 static int seq_init (struct msgs *, char *, char *);
  * 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 *);
 
 
 static void seq_private (struct msgs *);
 
 
@@ -26,7 +26,7 @@ static void seq_private (struct msgs *);
  */
 
 void
  */
 
 void
-seq_read (struct msgs *mp)
+seq_read (struct msgs *mp, int lockflag)
 {
     /*
      * Initialize the list of sequence names.  Go ahead and
 {
     /*
      * Initialize the list of sequence names.  Go ahead and
@@ -41,7 +41,7 @@ seq_read (struct msgs *mp)
        return;
 
     /* Initialize the public sequences */
        return;
 
     /* Initialize the public sequences */
-    seq_public (mp);
+    seq_public (mp, lockflag);
 
     /* Initialize the private sequences */
     seq_private (mp);
 
     /* Initialize the private sequences */
     seq_private (mp);
@@ -53,7 +53,7 @@ seq_read (struct msgs *mp)
  */
 
 static void
  */
 
 static void
-seq_public (struct msgs *mp)
+seq_public (struct msgs *mp, int lockflag)
 {
     int state;
     char *cp, seqfile[PATH_MAX];
 {
     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);
 
     /* 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 */
        return;
 
     /* Use m_getfld to scan sequence file */
@@ -96,7 +96,8 @@ seq_public (struct msgs *mp)
                }
                continue;
 
                }
                continue;
 
-           case BODY: 
+           case BODY:
+               lkfclosedata (fp, seqfile);
                adios (NULL, "no blank lines are permitted in %s", seqfile);
                /* fall */
 
                adios (NULL, "no blank lines are permitted in %s", seqfile);
                /* fall */
 
@@ -104,13 +105,19 @@ seq_public (struct msgs *mp)
                break;
 
            default: 
                break;
 
            default: 
+               lkfclosedata (fp, seqfile);
                adios (NULL, "%s is poorly formatted", seqfile);
        }
        break;  /* break from for loop */
     }
     m_getfld_state_destroy (&gstate);
 
                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 837b4ba..3c53e4b 100644 (file)
@@ -30,8 +30,11 @@ seq_save (struct msgs *mp)
     sigset_t set, oset;
 
     /* check if sequence information has changed */
     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;
        return;
+    }
     mp->msgflags &= ~SEQMOD;
 
     fp = NULL;
     mp->msgflags &= ~SEQMOD;
 
     fp = NULL;
@@ -74,7 +77,15 @@ priv:
                 * If that fails (probably because folder is
                 * readonly), then make sequence private.
                 */
                 * 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");
                        && (unlink (seqfile) == -1 ||
                            (fp = lkfopendata (seqfile, "w")) == NULL)) {
                    admonish (attr, "unable to write");
index cf52021..d18713a 100644 (file)
@@ -240,7 +240,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index e479233..34ef10b 100644 (file)
@@ -158,7 +158,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 416a885..be7968d 100644 (file)
@@ -256,7 +256,7 @@ main (int argc, char **argv)
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            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 */
        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!");
 
        if (mp->numsel > 1)
            adios (NULL, "only one message at a time!");
index 3d24718..d3ceaec 100644 (file)
@@ -281,7 +281,7 @@ try_it_again:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index 1444aca..d0945fc 100644 (file)
@@ -468,7 +468,7 @@ AddFolder(char *name, int force)
     struct msgs *mp;
 
     /* Read folder and create message structure */
     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++];
        /* Oops, error occurred.  Record it and continue. */
        AllocFolders(&folders, &nFoldersAlloced, nFolders + 1);
        f = &folders[nFolders++];
index dafdbdb..8b81924 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 (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)
        adios(NULL, "unable to read folder %s", folder);
 
     if (mp->nummsg == 0)
index e4defc7..29ef616 100644 (file)
@@ -403,7 +403,7 @@ get_folder_info_body (char *fold, char *msg, boolean *crawl_children)
        /*
         * create message structure and get folder info
         */
        /*
         * 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;
        }
            admonish (NULL, "unable to read folder %s", fold);
            return 0;
        }
index 18a4f03..45fb740 100644 (file)
@@ -363,7 +363,7 @@ try_it_again:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index 6f7f594..2b4c7ce 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 */
        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:
        adios (NULL, "unable to read folder %s", folder);
 
 go_to_it:
index f99832a..cc5a713 100644 (file)
@@ -159,7 +159,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* print some general debugging info */
index 8bac6d3..459a255 100644 (file)
@@ -753,7 +753,7 @@ use_forw:
        if (!folder)
            folder = add (getfolder (1), NULL);
 
        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;
            adios (NULL, "unable to read folder %s", folder);
        for (ap = arguments; *ap; ap++) {
            cp = *ap;
index 6ab50e3..3806073 100644 (file)
@@ -278,7 +278,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index a5a7b05..ced10f2 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 */
            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 */
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index ef16bce..3a0a628 100644 (file)
@@ -91,7 +91,7 @@ main(int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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);
 
     /*
        adios (NULL, "unable to read folder %s", folder);
 
     /*
index f5666b0..76a0d02 100644 (file)
@@ -336,7 +336,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index 1865f14..cd84aee 100644 (file)
@@ -304,7 +304,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index b978dbf..6badafe 100644 (file)
@@ -872,7 +872,7 @@ output_content_folder (char *folder, char *filename)
     struct msgs *mp;
 
     /* Read the folder. */
     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 {
        /* Link file into folder */
        msgnum = folder_addmsg (&mp, filename, 0, 0, 0, 0, (char *)0);
     } else {
index cf7f864..aa6d8e4 100644 (file)
@@ -270,7 +270,7 @@ do_cache:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index 2a562f0..c1f0fc3 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 */
        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 */
        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 */
 
        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;
            padios (NULL, "unable to re-read folder %s", fmsh);
 
        hgh = mp->hghmsg;
index 53e696a..d82ef78 100644 (file)
@@ -138,7 +138,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to ");
 
     /* read folder and create message structure */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 5549ea6..281a1ac 100644 (file)
@@ -193,7 +193,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 3afe12e..9a89230 100644 (file)
@@ -193,7 +193,7 @@ main (int argc, char **argv)
     /*
      * read folder and create message structure
      */
     /*
      * 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);
 
     /*
        adios (NULL, "unable to read folder %s", folder);
 
     /*
index 54b6e5f..8dd04fb 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 */
        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 */
        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 (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;
 
            adios (NULL, "unable to read folder %s", fp->f_name);
        mp->curmsg = 0;
 
index e8d6490..840b762 100644 (file)
@@ -386,7 +386,7 @@ try_it_again:
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            adios (NULL, "unable to read folder %s", folder);
 
        /* check for empty folder */
index d96622e..02a5591 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 */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 459fcb0..2996a2b 100644 (file)
@@ -201,7 +201,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 510047a..8a65922 100644 (file)
@@ -350,7 +350,7 @@ main (int argc, char **argv)
            adios (maildir, "unable to change directory to");
 
        /* read folder and create message structure */
            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 */
            adios (NULL, "unable to read folder %s", dfolder);
 
        /* check for empty folder */
index e3a8195..2a5ad82 100644 (file)
@@ -1064,7 +1064,7 @@ annoaux (int fd)
            admonish (maildir, "unable to change directory to");
        return;
     }
            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;
        if (debugsw)
            admonish (NULL, "unable to read folder %s", folder);
        return;
index dc42613..b73e56a 100644 (file)
@@ -221,7 +221,7 @@ usage:
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */
index 6e7a749..ea6b805 100644 (file)
@@ -199,7 +199,7 @@ main (int argc, char **argv)
        adios (maildir, "unable to change directory to");
 
     /* read folder and create message structure */
        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 */
        adios (NULL, "unable to read folder %s", folder);
 
     /* check for empty folder */