Mercurial > dovecot > core-2.2
changeset 22622:c0417a608a71
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.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Mon, 16 Oct 2017 13:53:58 +0300 |
parents | a91a473c65f7 |
children | f733d647ff82 |
files | src/lib-fs/fs-wrapper.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-fs/fs-wrapper.c Thu Oct 19 14:39:01 2017 +0300 +++ b/src/lib-fs/fs-wrapper.c Mon Oct 16 13:53:58 2017 +0300 @@ -78,14 +78,14 @@ 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,