dovecot-2.2: dsync: Use i_stream_get_error() instead of just err...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Nov 6 17:14:08 EET 2013
details: http://hg.dovecot.org/dovecot-2.2/rev/38f404297728
changeset: 16940:38f404297728
user: Timo Sirainen <tss at iki.fi>
date: Wed Nov 06 17:13:53 2013 +0200
description:
dsync: Use i_stream_get_error() instead of just errno in stream error messages.
diffstat:
src/doveadm/dsync/dsync-ibc-stream.c | 13 +++++++------
src/doveadm/dsync/dsync-mailbox-import.c | 12 +++++++-----
2 files changed, 14 insertions(+), 11 deletions(-)
diffs (70 lines):
diff -r b013764afe7c -r 38f404297728 src/doveadm/dsync/dsync-ibc-stream.c
--- 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);
diff -r b013764afe7c -r 38f404297728 src/doveadm/dsync/dsync-mailbox-import.c
--- 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) {
More information about the dovecot-cvs
mailing list