From: Timo Sirainen Date: Fri, 17 Oct 2014 23:13:30 +0000 (+0300) Subject: doveadm fetch: If istream reading fails, log a better error message. X-Git-Tag: 2.2.15~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f7a3d6bbc4601e293656295f2aa44dc67e1cb16;p=thirdparty%2Fdovecot%2Fcore.git doveadm fetch: If istream reading fails, log a better error message. --- diff --git a/src/doveadm/doveadm-mail-fetch.c b/src/doveadm/doveadm-mail-fetch.c index b9e01b5bf9..dbaa79ab3b 100644 --- a/src/doveadm/doveadm-mail-fetch.c +++ b/src/doveadm/doveadm-mail-fetch.c @@ -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;