From: Timo Sirainen Date: Fri, 16 Mar 2012 16:45:50 +0000 (+0200) Subject: dbox: Reverted recent fstat() avoidance change. It didn't do that, just broke mdbox. X-Git-Tag: 2.1.3~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d36607cf1a4293ffdc7e0a0ab2015331b4ce7e0c;p=thirdparty%2Fdovecot%2Fcore.git dbox: Reverted recent fstat() avoidance change. It didn't do that, just broke mdbox. --- diff --git a/src/lib-storage/index/dbox-common/dbox-file.c b/src/lib-storage/index/dbox-common/dbox-file.c index 03e49c304b..8b06d711ee 100644 --- a/src/lib-storage/index/dbox-common/dbox-file.c +++ b/src/lib-storage/index/dbox-common/dbox-file.c @@ -588,7 +588,7 @@ int dbox_file_get_append_stream(struct dbox_file_append_context *ctx, return 0; } - if (ctx->output->offset == 0 && !file->created) { + if (ctx->output->offset == 0) { /* first append to existing file. seek to eof first. */ if (fstat(file->fd, &st) < 0) { dbox_file_set_syscall_error(file, "fstat()"); diff --git a/src/lib-storage/index/dbox-common/dbox-file.h b/src/lib-storage/index/dbox-common/dbox-file.h index fc4fe5565b..bb7b81d0af 100644 --- a/src/lib-storage/index/dbox-common/dbox-file.h +++ b/src/lib-storage/index/dbox-common/dbox-file.h @@ -116,7 +116,6 @@ struct dbox_file { ARRAY_DEFINE(metadata, const char *); uoff_t metadata_read_offset; - unsigned int created:1; /* this file is now being created */ unsigned int appending:1; unsigned int deleted:1; unsigned int corrupted:1; diff --git a/src/lib-storage/index/dbox-multi/mdbox-file.c b/src/lib-storage/index/dbox-multi/mdbox-file.c index 4c4197a6ab..147ceeb049 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-file.c +++ b/src/lib-storage/index/dbox-multi/mdbox-file.c @@ -106,7 +106,6 @@ static int mdbox_file_create(struct mdbox_file *file) bool create_parents; int ret; - _file->created = TRUE; create_parents = dbox_file_is_in_alt(_file); _file->fd = _file->storage->v. file_create_fd(_file, _file->cur_path, create_parents); diff --git a/src/lib-storage/index/dbox-single/sdbox-file.c b/src/lib-storage/index/dbox-single/sdbox-file.c index 562ccb025d..af2ebd0377 100644 --- a/src/lib-storage/index/dbox-single/sdbox-file.c +++ b/src/lib-storage/index/dbox-single/sdbox-file.c @@ -60,7 +60,6 @@ struct dbox_file *sdbox_file_create(struct sdbox_mailbox *mbox) struct dbox_file *file; file = sdbox_file_init(mbox, 0); - file->created = TRUE; file->fd = file->storage->v. file_create_fd(file, file->primary_path, FALSE); return file;