Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6823:ee1c4c3d5e5a HEAD
Update cache->st_ino and st_dev after compressing.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 16 Nov 2007 23:55:31 +0200 |
parents | f814eecd75cd |
children | b8c66f025583 |
files | src/lib-index/mail-cache-compress.c |
diffstat | 1 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-cache-compress.c Fri Nov 16 20:19:40 2007 +0200 +++ b/src/lib-index/mail-cache-compress.c Fri Nov 16 23:55:31 2007 +0200 @@ -346,7 +346,8 @@ bool *unlock) { struct dotlock *dotlock; - mode_t old_mask; + struct stat st; + mode_t old_mask; uint32_t file_seq, old_offset; ARRAY_TYPE(uint32_t) ext_offsets; const uint32_t *offsets; @@ -398,6 +399,12 @@ return -1; } + if (fstat(fd, &st) < 0) { + mail_cache_set_syscall_error(cache, "fstat()"); + (void)file_dotlock_delete(&dotlock); + return -1; + } + if (file_dotlock_replace(&dotlock, DOTLOCK_REPLACE_FLAG_DONT_CLOSE_FD) < 0) { mail_cache_set_syscall_error(cache, @@ -426,6 +433,8 @@ mail_cache_file_close(cache); cache->fd = fd; + cache->st_ino = st.st_ino; + cache->st_dev = st.st_dev; if (cache->file_cache != NULL) file_cache_set_fd(cache->file_cache, cache->fd);