From 93542287dec792fb88af6fea38067767edab7fc8 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 10 Mar 2016 14:59:46 +1300 Subject: [PATCH] lib-fs: Fixed fs-sis to work again --- src/lib-fs/fs-posix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.47.3