Skip to content

Commit

Permalink
fs-metawrap: Propagate fs_write_stream_abort() to parent always
Browse files Browse the repository at this point in the history
It needed to be done also when temp_output==NULL, because we had already
started sending it to parent, but async parent wasn't being finished.
  • Loading branch information
sirainen committed May 12, 2016
1 parent cc8fdda commit 5a20b6b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/lib-fs/fs-metawrap.c
Expand Up @@ -394,10 +394,17 @@ static int fs_metawrap_write_stream_finish(struct fs_file *_file, bool success)
o_stream_unref(&_file->output);
}
if (!success) {
if (file->temp_output != NULL)
o_stream_destroy(&file->temp_output);
if (file->super_output != NULL)
if (file->super_output != NULL) {
/* no metawrap */
i_assert(file->temp_output == NULL);
fs_write_stream_abort(file->super, &file->super_output);
} else if (file->temp_output == NULL) {
/* finishing up */
i_assert(file->super_output == NULL);
fs_write_stream_abort(file->super, &file->super_output);
} else {
o_stream_destroy(&file->temp_output);
}
return -1;
}

Expand Down

0 comments on commit 5a20b6b

Please sign in to comment.