if (!changed)
return 0; /* nothing to do */
- /* Update the modification times on the mailbox.
+ /* Update the modification times on the mailbox.
*
* The monitor code notices changes in the open mailbox too quickly.
* In practice, this sometimes leads to all the new messages not being
else
#endif
{
- mutt_get_stat_timespec (&data->mtime_cur, &st_cur, MUTT_STAT_MTIME);
- mutt_get_stat_timespec (&ctx->mtime, &st_new, MUTT_STAT_MTIME);
+ mutt_get_stat_timespec(&data->mtime_cur, &st_cur, MUTT_STAT_MTIME);
+ mutt_get_stat_timespec(&ctx->mtime, &st_new, MUTT_STAT_MTIME);
}
/* do a fast scan of just the filenames in
if (!modified)
return 0;
- /* Update the modification times on the mailbox.
- *
- * The monitor code notices changes in the open mailbox too quickly.
- * In practice, this sometimes leads to all the new messages not being
- * noticed during the SAME group of mtime stat updates. To work around
- * the problem, don't update the stat times for a monitor caused check. */
+ /* Update the modification times on the mailbox.
+ *
+ * The monitor code notices changes in the open mailbox too quickly.
+ * In practice, this sometimes leads to all the new messages not being
+ * noticed during the SAME group of mtime stat updates. To work around
+ * the problem, don't update the stat times for a monitor caused check. */
#ifdef USE_INOTIFY
if (MonitorContextChanged)
MonitorContextChanged = 0;
else
#endif
{
- mutt_get_stat_timespec (&data->mtime_cur, &st_cur, MUTT_STAT_MTIME);
- mutt_get_stat_timespec (&ctx->mtime, &st, MUTT_STAT_MTIME);
+ mutt_get_stat_timespec(&data->mtime_cur, &st_cur, MUTT_STAT_MTIME);
+ mutt_get_stat_timespec(&ctx->mtime, &st, MUTT_STAT_MTIME);
}
md = NULL;
if (iter->magic == MUTT_MH && stat(iter->mh_backup_path, &sb) == 0)
{
if ((new_desc = inotify_add_watch(INotifyFd, iter->mh_backup_path,
- INOTIFY_MASK_FILE)) == -1)
+ INOTIFY_MASK_FILE)) == -1)
{
mutt_debug(2, "inotify_add_watch failed for '%s', errno=%d %s\n",
iter->mh_backup_path, errno, strerror(errno));
if (monitor_resolve(&info, mailbox) != RESOLVERES_OK_EXISTING)
return 2;
+ if (!mailbox && (MonitorContextDescriptor == info.monitor->desc))
+ MonitorContextDescriptor = -1;
+
if (Context)
{
if (mailbox)
mutt_debug(3, "inotify_rm_watch for '%s' descriptor=%d\n", info.path,
info.monitor->desc);
- if (!mailbox && (MonitorContextDescriptor == info.monitor->desc))
- MonitorContextDescriptor = -1;
-
monitor_delete(info.monitor);
monitor_check_free();
return 0;