]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Exclusive index locking always used copy-locking without even trying
authorTimo Sirainen <tss@iki.fi>
Sun, 20 Jun 2004 13:14:17 +0000 (16:14 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 20 Jun 2004 13:14:17 +0000 (16:14 +0300)
fcntl-locking.

--HG--
branch : HEAD

src/lib-index/mail-index-lock.c

index 3593fd8665bd21f6659cd03eb3673182a1843c28..4bc31a54ef2c142ac531f67b28e623e9680c4d52 100644 (file)
@@ -254,8 +254,8 @@ int mail_index_lock_exclusive(struct mail_index *index,
 
        /* if header size is smaller than what we have, we'll have to recreate
           the index to grow it. so don't even try regular locking. */
-       if (index->map->hdr == &index->map->hdr_copy &&
-           index->map->hdr->base_header_size < sizeof(*index->hdr)) {
+       if (index->map->hdr != &index->map->hdr_copy &&
+           index->map->hdr->base_header_size == sizeof(*index->hdr)) {
                /* wait two seconds for exclusive lock */
                ret = mail_index_lock(index, F_WRLCK, 2, TRUE, lock_id_r);
                if (ret > 0)