Mercurial > dovecot > original-hg > dovecot-1.2
changeset 9099:e77a5e5ffc9d HEAD
Maildir: Use i_stream_stat() instead of i_stream_get_fd()+fstat(). Fixes zlib plugin.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 31 May 2009 19:29:53 -0400 |
parents | 6e42cd6ae8a7 |
children | f144ef760714 |
files | src/lib-storage/index/maildir/maildir-mail.c |
diffstat | 1 files changed, 5 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-mail.c Thu May 28 14:42:21 2009 -0400 +++ b/src/lib-storage/index/maildir/maildir-mail.c Sun May 31 19:29:53 2009 -0400 @@ -72,8 +72,9 @@ { struct maildir_mailbox *mbox = (struct maildir_mailbox *)mail->box; struct index_mail *imail = (struct index_mail *)mail; + const struct stat *stp; const char *path; - int fd, ret; + int ret; if (mail->lookup_abort == MAIL_LOOKUP_ABORT_NOT_IN_CACHE) return mail_set_aborted(mail); @@ -86,15 +87,11 @@ } if (imail->data.stream != NULL) { - fd = i_stream_get_fd(imail->data.stream); - i_assert(fd != -1); - imail->mail.stats_fstat_lookup_count++; - if (fstat(fd, st) < 0) { - mail_storage_set_critical(&mbox->storage->storage, - "fstat(maildir) failed: %m"); + stp = i_stream_stat(imail->data.stream, FALSE); + if (stp == NULL) return -1; - } + *st = *stp; } else if (mail->uid != 0) { imail->mail.stats_stat_lookup_count++; ret = maildir_file_do(mbox, mail->uid, do_stat, st);