Mercurial > dovecot > core-2.2
changeset 16940:38f404297728
dsync: Use i_stream_get_error() instead of just errno in stream error messages.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 06 Nov 2013 17:13:53 +0200 |
parents | b013764afe7c |
children | e67095b8486e |
files | src/doveadm/dsync/dsync-ibc-stream.c src/doveadm/dsync/dsync-mailbox-import.c |
diffstat | 2 files changed, 14 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/dsync/dsync-ibc-stream.c Wed Nov 06 16:33:37 2013 +0200 +++ b/src/doveadm/dsync/dsync-ibc-stream.c Wed Nov 06 17:13:53 2013 +0200 @@ -174,8 +174,8 @@ } while (i_stream_read(ibc->value_input) > 0); if (ibc->value_input->eof) { if (ibc->value_input->stream_errno != 0) { - errno = ibc->value_input->stream_errno; - i_error("dsync(%s): read() failed: %m", ibc->name); + i_error("dsync(%s): read() failed: %s", ibc->name, + i_stream_get_error(ibc->value_input)); dsync_ibc_stream_stop(ibc); return -1; } @@ -246,8 +246,9 @@ i_assert(ret == -1); if (ibc->value_output->stream_errno != 0) { - i_error("dsync(%s): read(%s) failed: %m", - ibc->name, i_stream_get_name(ibc->value_output)); + i_error("dsync(%s): read(%s) failed: %s", + ibc->name, i_stream_get_name(ibc->value_output), + i_stream_get_error(ibc->value_output)); dsync_ibc_stream_stop(ibc); return -1; } @@ -371,8 +372,8 @@ return -1; error = t_str_new(128); if (ibc->input->stream_errno != 0) { - errno = ibc->input->stream_errno; - str_printfa(error, "read(%s) failed: %m", ibc->name); + str_printfa(error, "read(%s) failed: %s", ibc->name, + i_stream_get_error(ibc->input)); } else { i_assert(ibc->input->eof); str_printfa(error, "read(%s) failed: EOF", ibc->name);
--- a/src/doveadm/dsync/dsync-mailbox-import.c Wed Nov 06 16:33:37 2013 +0200 +++ b/src/doveadm/dsync/dsync-mailbox-import.c Wed Nov 06 17:13:53 2013 +0200 @@ -299,12 +299,14 @@ } if (input1->stream_errno != 0) { errno = input1->stream_errno; - i_error("read(%s) failed: %m", i_stream_get_name(input1)); + i_error("read(%s) failed: %s", i_stream_get_name(input1), + i_stream_get_error(input1)); return -1; } if (input2->stream_errno != 0) { errno = input2->stream_errno; - i_error("read(%s) failed: %m", i_stream_get_name(input2)); + i_error("read(%s) failed: %s", i_stream_get_name(input2), + i_stream_get_error(input2)); return -1; } if (size1 == 0 && size2 == 0) @@ -1960,9 +1962,9 @@ i_assert(ret == -1); if (mail->input->stream_errno != 0) { - errno = mail->input->stream_errno; - i_error("Mailbox %s: read(msg input) failed: %m", - mailbox_get_vname(importer->box)); + i_error("Mailbox %s: read(msg input) failed: %s", + mailbox_get_vname(importer->box), + i_stream_get_error(mail->input)); mailbox_save_cancel(&save_ctx); importer->failed = TRUE; } else if (save_failed) {