From 0cf4f39f69167d08b23c720570e0bfbc27e3ac8e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 16 Oct 2017 13:53:58 +0300 Subject: [PATCH] lib-fs: Fix fs_wrapper_write_stream_finish() to work with async parent fs This only became a problem with the previous fs-compress change. --- src/lib-fs/fs-wrapper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib-fs/fs-wrapper.c b/src/lib-fs/fs-wrapper.c index 1cc245c6e2..80240ee831 100644 --- a/src/lib-fs/fs-wrapper.c +++ b/src/lib-fs/fs-wrapper.c @@ -78,14 +78,14 @@ void fs_wrapper_write_stream(struct fs_file *file) int fs_wrapper_write_stream_finish(struct fs_file *file, bool success) { + if (file->output == NULL) + return fs_write_stream_finish_async(file->parent); + if (!success) { fs_write_stream_abort_parent(file, &file->output); return -1; } - - if (fs_write_stream_finish(file->parent, &file->output) < 0) - return -1; - return 1; + return fs_write_stream_finish(file->parent, &file->output); } int fs_wrapper_lock(struct fs_file *file, unsigned int secs, -- 2.47.3