Browse Source

*** work around readdir() sometimes returning the same entries multiple times

this appears to ever happen only on my ReiserFS partition at home. it's
not reproducible with "ls -U", mc, or any attempt at looping mbsync - it
happens from time to time when mbsync runs in the background during
regular operation.
wip/maildir-uid-dupes-test
Oswald Buddenhagen 11 years ago
parent
commit
f1f6d33bad
  1. 5
      src/drv_maildir.c

5
src/drv_maildir.c

@ -764,6 +764,11 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
qsort( msglist->ents, msglist->nents, sizeof(msg_t), maildir_compare );
for (uid = i = 0; i < msglist->nents; i++) {
entry = &msglist->ents[i];
/* ReiserFS bogosity hack. */
if (i && !strcmp( entry->base, msglist->ents[i-1].base )) {
warn( "Maildir warning: duplicate directory entries. Retrying ...\n" );
goto retry;
}
if (entry->uid != INT_MAX) {
if (uid == entry->uid) {
#if 1

Loading…
Cancel
Save