]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Use i_stream_get_error() instead of just errno in stream error messages.
authorTimo Sirainen <tss@iki.fi>
Wed, 6 Nov 2013 15:13:53 +0000 (17:13 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 6 Nov 2013 15:13:53 +0000 (17:13 +0200)
src/doveadm/dsync/dsync-ibc-stream.c
src/doveadm/dsync/dsync-mailbox-import.c

index ac4523854f5e85df3fd043d496547f79d8acca0e..cf64628ef5e844b0b948bc42e05e1c1df2c92786 100644 (file)
@@ -174,8 +174,8 @@ static int dsync_ibc_stream_read_mail_stream(struct dsync_ibc_stream *ibc)
        } 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 @@ static int dsync_ibc_stream_send_value_stream(struct dsync_ibc_stream *ibc)
        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 @@ static int dsync_ibc_stream_next_line(struct dsync_ibc_stream *ibc,
                        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);
index 06c1fe7e24e73393daba0956f4750a105dac9e89..ac0917d47b17633c7d62a72f5706846fca1f6d54 100644 (file)
@@ -299,12 +299,14 @@ dsync_istreams_cmp(struct istream *input1, struct istream *input2, int *cmp_r)
        }
        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 @@ static void dsync_mailbox_save_body(struct dsync_mailbox_importer *importer,
        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) {