summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libproto/dotmail/dotmail.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libproto/dotmail/dotmail.c b/libproto/dotmail/dotmail.c
index 48ca756..fa083bb 100644
--- a/libproto/dotmail/dotmail.c
+++ b/libproto/dotmail/dotmail.c
@@ -326,12 +326,15 @@ dotmail_rescan_unlocked (mu_mailbox_t mailbox, mu_off_t offset)
326 "x-imapbase:", 326 "x-imapbase:",
327 "x-uid: ", 327 "x-uid: ",
328 }; 328 };
329 int i, j; 329 int i, j;
330 int force_init_uids = 0; 330 int force_init_uids = 0;
331 331
332 if (!(mailbox->flags & MU_STREAM_READ))
333 return 0;
334
332 rc = mu_streamref_create (&stream, mailbox->stream); 335 rc = mu_streamref_create (&stream, mailbox->stream);
333 if (rc) 336 if (rc)
334 { 337 {
335 mu_debug (MU_DEBCAT_MAILBOX, MU_DEBUG_ERROR, 338 mu_debug (MU_DEBCAT_MAILBOX, MU_DEBUG_ERROR,
336 ("%s:%s (%s): %s", 339 ("%s:%s (%s): %s",
337 __func__, "mu_streamref_create", dmp->name, 340 __func__, "mu_streamref_create", dmp->name,
@@ -587,12 +590,15 @@ dotmail_rescan (mu_mailbox_t mailbox, mu_off_t offset)
587 struct mu_dotmail_mailbox *dmp = mailbox->data; 590 struct mu_dotmail_mailbox *dmp = mailbox->data;
588 int rc; 591 int rc;
589 592
590 if (!dmp) 593 if (!dmp)
591 return EINVAL; 594 return EINVAL;
592 595
596 if (!(mailbox->flags & MU_STREAM_READ))
597 return 0;
598
593 mu_monitor_wrlock (mailbox->monitor); 599 mu_monitor_wrlock (mailbox->monitor);
594#ifdef WITH_PTHREAD 600#ifdef WITH_PTHREAD
595 pthread_cleanup_push (dotmail_cleanup, (void *)mailbox); 601 pthread_cleanup_push (dotmail_cleanup, (void *)mailbox);
596#endif 602#endif
597 603
598 rc = mu_stream_size (mailbox->stream, &dmp->size); 604 rc = mu_stream_size (mailbox->stream, &dmp->size);

Return to:

Send suggestions and report system problems to the System administrator.