]> granicus.if.org Git - neomutt/commitdiff
Open folders in read-only mode if mutt can't lock them.
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 12 Jan 1999 22:01:11 +0000 (22:01 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 12 Jan 1999 22:01:11 +0000 (22:01 +0000)
mbox.c

diff --git a/mbox.c b/mbox.c
index 90c0c8fdad5bc9bc5b80eec3a945a434ab24dd08..22c241adbbed07fe372ff64cdc0363f4ee44915d 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -53,13 +53,14 @@ int mbox_lock_mailbox (CONTEXT *ctx, int excl, int retry)
 {
   int r;
 
-  /* XXX - Currently, we force dotlocking.
-   * Use dotlock -t here.
-   */
-
   if ((r = mx_lock_file (ctx->path, fileno (ctx->fp), excl, 1, retry)) == 0)
     ctx->locked = 1;
-
+  else if (retry && !excl)
+  {
+    ctx->readonly = 1;
+    return 0;
+  }
+  
   return (r);
 }
 
@@ -575,7 +576,7 @@ int mbox_check_mailbox (CONTEXT *ctx, int *index_hint)
          /* we couldn't lock the mailbox, but nothing serious happened:
           * probably the new mail arrived: no reason to wait till we can
           * parse it: we'll get it on the next pass
-          *  */
+          */
          return (M_LOCKED);
        }
        unlock = 1;