]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Fixed fs_get_metadata() with fs-metawrap
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 29 Apr 2016 22:05:47 +0000 (01:05 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 29 Apr 2016 22:07:41 +0000 (01:07 +0300)
If mail was already read to EOF.

src/lib-fs/fs-metawrap.c

index ee187b96098a3d1d0ad35d4ee393221665bc4e60..0e9f09f70d7a54d7dca57ac69f228436c42b9025 100644 (file)
@@ -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;