dovecot-2.1: script-login: If we fail to finish, exit with 0 to ...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jan 20 17:43:06 EET 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/db37a5818b92
changeset: 13963:db37a5818b92
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jan 20 17:42:15 2012 +0200
description:
script-login: If we fail to finish, exit with 0 to avoid master logging error unnecessarily.

diffstat:

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

diffs (27 lines):

diff -r 00a27339f541 -r db37a5818b92 src/util/script-login.c
--- a/src/util/script-login.c	Fri Jan 20 17:06:06 2012 +0200
+++ b/src/util/script-login.c	Fri Jan 20 17:42:15 2012 +0200
@@ -177,12 +177,19 @@
 	}
 	str_append_c(reply, '\n');
 
+	/* finish by sending the fd to the mail process */
 	ret = fd_send(SCRIPT_COMM_FD, STDOUT_FILENO,
 		      str_data(reply), str_len(reply));
-	if (ret < 0)
-		i_fatal("fd_send() failed: %m");
-	else if (ret != (ssize_t)str_len(reply))
-		i_fatal("fd_send() sent partial output");
+	if (ret == (ssize_t)str_len(reply)) {
+		/* success */
+	} else {
+		if (ret < 0)
+			i_error("fd_send() failed: %m");
+		else
+			i_error("fd_send() sent partial output");
+		/* exit with 0 even though we failed. non-0 exit just makes
+		   master log an unnecessary error. */
+	}
 }
 
 int main(int argc, char *argv[])


More information about the dovecot-cvs mailing list