]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Fix fs_wrapper_write_stream_finish() to work with async parent fs
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 16 Oct 2017 10:53:58 +0000 (13:53 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 16 Oct 2017 10:53:58 +0000 (13:53 +0300)
This only became a problem with the previous fs-compress change.

src/lib-fs/fs-wrapper.c

index 1cc245c6e2f4ed41b41b8671f8bd62c87ac5841b..80240ee831c26ae423c8f37a31cb6f3a9c84570b 100644 (file)
@@ -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,