Skip to content

Commit

Permalink
lib-fs: Fixed fs_get_metadata() with fs-metawrap
Browse files Browse the repository at this point in the history
If mail was already read to EOF.
  • Loading branch information
sirainen committed Apr 30, 2016
1 parent 45290c6 commit 5ceee21
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib-fs/fs-metawrap.c
Expand Up @@ -220,8 +220,12 @@ fs_metawrap_get_metadata(struct fs_file *_file,
if (fs_wait_async(_file->fs) < 0)
return -1;
}
if (ret == -1)
if (ret == -1 && file->input->stream_errno != 0) {
fs_set_error(_file->fs, "read(%s) failed: %s",
i_stream_get_name(file->input),
i_stream_get_error(file->input));
return -1;
}
i_assert(file->metadata_read);
}
*metadata_r = &_file->metadata;
Expand Down

0 comments on commit 5ceee21

Please sign in to comment.