dovecot-2.2: dsync: Don't close stdin/stdout when not supposed to.

dovecot at dovecot.org dovecot at dovecot.org
Mon Feb 25 16:58:10 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/608d07701d54
changeset: 15936:608d07701d54
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Feb 25 16:58:02 2013 +0200
description:
dsync: Don't close stdin/stdout when not supposed to.

diffstat:

 src/doveadm/dsync/doveadm-dsync.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 4baf0183f13d -r 608d07701d54 src/doveadm/dsync/doveadm-dsync.c
--- a/src/doveadm/dsync/doveadm-dsync.c	Mon Feb 25 16:12:49 2013 +0200
+++ b/src/doveadm/dsync/doveadm-dsync.c	Mon Feb 25 16:58:02 2013 +0200
@@ -539,7 +539,6 @@
 	case SERVER_CMD_REPLY_OK:
 		server_connection_extract(ctx->tcp_conn, &ctx->input,
 					  &ctx->output, &ctx->ssl_iostream);
-		ctx->fd_in = ctx->fd_out = -1;
 		break;
 	case SERVER_CMD_REPLY_INTERNAL_FAILURE:
 		ctx->error = "Disconnected from remote";
@@ -662,8 +661,8 @@
 
 	user_set = mail_storage_service_user_get_set(service_user)[0];
 
-	ctx->fd_in = STDIN_FILENO;
-	ctx->fd_out = STDOUT_FILENO;
+	ctx->fd_in = -1;
+	ctx->fd_out = -1;
 	ctx->fd_err = -1;
 	ctx->run_type = DSYNC_RUN_TYPE_LOCAL;
 	ctx->remote_name = "remote";
@@ -700,6 +699,8 @@
 	if (remote_cmd_args != NULL) {
 		/* do this before mail_storage_service_next() in case it
 		   drops process privileges */
+		ctx->fd_in = STDIN_FILENO;
+		ctx->fd_out = STDIN_FILENO;
 		run_cmd(ctx, remote_cmd_args);
 		ctx->run_type = DSYNC_RUN_TYPE_CMD;
 	}


More information about the dovecot-cvs mailing list