On 2018-06-11 08:07:22 +0800, Kevin J. McCarthy wrote: > On Sun, Jun 10, 2018 at 10:33:15AM +0200, Vincent Lefevre wrote: > > Now I'm thinking that there may be a more important new race condition > > due to inotify because files could be looked as soon as they appear, > > and if there is an mtime correction (which occurs here, AFAIK, as I'm > > using unison to retrieve mail and synchronize between various copies > > of my mailboxes), this might confuse Mutt. > > This sounds plausible. If mx_check_mailbox() is run immediately, it may > record the st_mtime before it is reset by unison. > > What if instead, we changed the code from a ">" comparison to a "!=" > comparison. This would force a rescan if the mtime were reset backwards: > > /* determine which subdirectories need to be scanned */ > if (st_new.st_mtime != ctx->mtime) > changed = 1; > if (st_cur.st_mtime != data->mtime_cur) > changed |= 2;
I'll have to try. But I'm wondering why there is no rescan after one does a sync-mailbox with actual changes: in any case, this may be necessary as new mail could arrive during this time. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)