dovecot-2.2: dsync: Fixed printing output state when running via...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jan 10 06:52:48 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/29e5702b23ab
changeset: 15621:29e5702b23ab
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jan 10 06:52:37 2013 +0200
description:
dsync: Fixed printing output state when running via doveadm-server.

diffstat:

 src/doveadm/dsync/doveadm-dsync.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 90a603209bad -r 29e5702b23ab src/doveadm/dsync/doveadm-dsync.c
--- a/src/doveadm/dsync/doveadm-dsync.c	Thu Jan 10 06:51:19 2013 +0200
+++ b/src/doveadm/dsync/doveadm-dsync.c	Thu Jan 10 06:52:37 2013 +0200
@@ -18,6 +18,7 @@
 #include "mailbox-list.h"
 #include "doveadm-settings.h"
 #include "doveadm-mail.h"
+#include "doveadm-print.h"
 #include "dsync-brain.h"
 #include "dsync-ibc.h"
 #include "doveadm-dsync.h"
@@ -404,7 +405,7 @@
 	if (ctx->state_input != NULL) {
 		string_t *str = t_str_new(128);
 		dsync_brain_get_state(brain, str);
-		printf("%s\n", str_c(str));
+		doveadm_print(str_c(str));
 	}
 
 	if (dsync_brain_deinit(&brain) < 0)
@@ -566,6 +567,9 @@
 	ctx->ctx.v.prerun = cmd_dsync_prerun;
 	ctx->ctx.v.run = cmd_dsync_run;
 	ctx->sync_type = DSYNC_BRAIN_SYNC_TYPE_CHANGED;
+	doveadm_print_init(DOVEADM_PRINT_TYPE_FLOW);
+	doveadm_print_header("state", "state",
+			     DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE);
 	return &ctx->ctx;
 }
 
@@ -649,6 +653,9 @@
 	ctx->sync_type = DSYNC_BRAIN_SYNC_TYPE_CHANGED;
 	ctx->fd_in = STDIN_FILENO;
 	ctx->fd_out = STDOUT_FILENO;
+	doveadm_print_init(DOVEADM_PRINT_TYPE_FLOW);
+	doveadm_print_header("state", "state",
+			     DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE);
 	return &ctx->ctx;
 }
 


More information about the dovecot-cvs mailing list