From: Timo Sirainen Date: Thu, 10 Mar 2016 01:59:46 +0000 (+1300) Subject: lib-fs: Fixed fs-sis to work again X-Git-Tag: 2.2.22~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93542287dec792fb88af6fea38067767edab7fc8;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Fixed fs-sis to work again --- diff --git a/src/lib-fs/fs-posix.c b/src/lib-fs/fs-posix.c index 566ea738d8..3e4a779237 100644 --- a/src/lib-fs/fs-posix.c +++ b/src/lib-fs/fs-posix.c @@ -648,7 +648,10 @@ static int fs_posix_stat(struct fs_file *_file, struct stat *st_r) { struct posix_fs_file *file = (struct posix_fs_file *)_file; - if (file->fd != -1) { + /* in case output != NULL it means that we're still writing to the file + and fs_stat() shouldn't stat the unfinished file. this is done by + fs-sis after fs_copy(). */ + if (file->fd != -1 && _file->output == NULL) { if (fstat(file->fd, st_r) < 0) { fs_set_error(_file->fs, "fstat(%s) failed: %m", file->full_path); return -1;