From: Timo Sirainen Date: Mon, 16 Oct 2017 10:53:58 +0000 (+0300) Subject: lib-fs: Fix fs_wrapper_write_stream_finish() to work with async parent fs X-Git-Tag: 2.3.0.rc1~827 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0cf4f39f69167d08b23c720570e0bfbc27e3ac8e;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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,