]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm fetch: If istream reading fails, log a better error message.
authorTimo Sirainen <tss@iki.fi>
Fri, 17 Oct 2014 23:13:30 +0000 (02:13 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 17 Oct 2014 23:13:30 +0000 (02:13 +0300)
src/doveadm/doveadm-mail-fetch.c

index b9e01b5bf9cf22df57d020d8795bf5a84e96541c..dbaa79ab3b2e3b91d8e5273cce9e6cc6c119a055 100644 (file)
@@ -128,7 +128,8 @@ static int fetch_hdr(struct fetch_cmd_context *ctx)
                i_stream_skip(input, size);
        }
        if (input->stream_errno != 0) {
-               i_error("read() failed: %m");
+               i_error("read(%s) failed: %s", i_stream_get_name(input),
+                       i_stream_get_error(input));
                ret = -1;
        }
        i_stream_unref(&input);
@@ -222,7 +223,8 @@ static int fetch_body(struct fetch_cmd_context *ctx)
                i_stream_skip(input, size);
        }
        if (input->stream_errno != 0) {
-               i_error("read() failed: %m");
+               i_error("read(%s) failed: %s", i_stream_get_name(input),
+                       i_stream_get_error(input));
                ret = -1;
        }
        doveadm_print_stream("", 0);
@@ -248,7 +250,8 @@ static int fetch_text(struct fetch_cmd_context *ctx)
                i_stream_skip(input, size);
        }
        if (input->stream_errno != 0) {
-               i_error("read() failed: %m");
+               i_error("read(%s) failed: %s", i_stream_get_name(input),
+                       i_stream_get_error(input));
                ret = -1;
        }
        doveadm_print_stream("", 0);
@@ -300,7 +303,8 @@ static int fetch_text_utf8(struct fetch_cmd_context *ctx)
 
        doveadm_print_stream("", 0);
        if (input->stream_errno != 0) {
-               i_error("read() failed: %m");
+               i_error("read(%s) failed: %s", i_stream_get_name(input),
+                       i_stream_get_error(input));
                return -1;
        }
        return 0;