Skip to content

Commit

Permalink
fs-metawrap: Added assert to make sure we don't create empty files.
Browse files Browse the repository at this point in the history
It seems like this could be happening in some situation.
  • Loading branch information
sirainen committed Sep 9, 2016
1 parent bd64561 commit 38a2542
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib-fs/fs-metawrap.c
Expand Up @@ -410,6 +410,9 @@ static int fs_metawrap_write_stream_finish(struct fs_file *_file, bool success)
ret = -1;
} else {
i_assert(i_stream_is_eof(input));
/* because of the "end of metadata" LF, there's always at least
1 byte */
i_assert(file->super_output->offset > 0);
ret = fs_write_stream_finish(_file->parent, &file->super_output);
}
i_stream_unref(&input);
Expand Down

0 comments on commit 38a2542

Please sign in to comment.