dovecot-2.1: script-login: Close extra fds to avoid failing with...

dovecot at dovecot.org dovecot at dovecot.org
Tue Dec 20 14:40:09 EET 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/477106b6f4c7
changeset: 13871:477106b6f4c7
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Dec 20 14:40:18 2011 +0200
description:
script-login: Close extra fds to avoid failing with --enable-devel-checks.

diffstat:

 src/util/script-login.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r 53114d335053 -r 477106b6f4c7 src/util/script-login.c
--- a/src/util/script-login.c	Tue Dec 20 13:16:55 2011 +0200
+++ b/src/util/script-login.c	Tue Dec 20 14:40:18 2011 +0200
@@ -128,9 +128,13 @@
 		i_fatal("dup2() failed: %m");
 	if (dup2(fd, STDOUT_FILENO) < 0)
 		i_fatal("dup2() failed: %m");
+	if (close(fd) < 0)
+		i_fatal("close() failed: %m");
 	if (conn->fd != SCRIPT_COMM_FD) {
 		if (dup2(conn->fd, SCRIPT_COMM_FD) < 0)
 			i_fatal("dup2() failed: %m");
+		if (close(conn->fd) < 0)
+			i_fatal("close() failed: %m");
 	}
 
 	/* close all listener sockets */


More information about the dovecot-cvs mailing list