dovecot-2.2: dsync: Don't hide the final error messages from rem...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Feb 16 16:44:24 EET 2013
details: http://hg.dovecot.org/dovecot-2.2/rev/e4aba707f867
changeset: 15780:e4aba707f867
user: Timo Sirainen <tss at iki.fi>
date: Sat Feb 16 16:44:13 2013 +0200
description:
dsync: Don't hide the final error messages from remote.
diffstat:
src/doveadm/dsync/doveadm-dsync.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diffs (39 lines):
diff -r 4e90a6911b26 -r e4aba707f867 src/doveadm/dsync/doveadm-dsync.c
--- a/src/doveadm/dsync/doveadm-dsync.c Sat Feb 16 14:51:50 2013 +0200
+++ b/src/doveadm/dsync/doveadm-dsync.c Sat Feb 16 16:44:13 2013 +0200
@@ -466,22 +466,27 @@
dsync_ibc_deinit(&ibc);
if (ibc2 != NULL)
dsync_ibc_deinit(&ibc2);
+ if (ctx->fd_in != -1) {
+ if (ctx->fd_out != ctx->fd_in)
+ i_close_fd(&ctx->fd_out);
+ i_close_fd(&ctx->fd_in);
+ }
+ if (ctx->remote)
+ cmd_dsync_wait_remote(ctx, remote_errors_logged);
+
+ /* print any final errors after the process has died. not closing
+ stdin/stdout before wait() may cause the process to hang, but stderr
+ shouldn't (at least with ssh) and we need stderr to be open to be
+ able to print the final errors */
if (ctx->err_stream != NULL) {
- remote_error_input(ctx); /* print any pending errors */
+ remote_error_input(ctx);
remote_errors_logged = ctx->err_stream->v_offset > 0;
i_stream_destroy(&ctx->err_stream);
}
if (ctx->io_err != NULL)
io_remove(&ctx->io_err);
- if (ctx->fd_in != -1) {
- if (ctx->fd_out != ctx->fd_in)
- i_close_fd(&ctx->fd_out);
- i_close_fd(&ctx->fd_in);
- }
if (ctx->fd_err != -1)
i_close_fd(&ctx->fd_err);
- if (ctx->remote)
- cmd_dsync_wait_remote(ctx, remote_errors_logged);
return ret;
}
More information about the dovecot-cvs
mailing list