From: Timo Sirainen Date: Fri, 20 Jan 2012 15:42:15 +0000 (+0200) Subject: script-login: If we fail to finish, exit with 0 to avoid master logging error unneces... X-Git-Tag: 2.1.rc4~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db0d5253bf0334625d7d20373230df29af7315cf;p=thirdparty%2Fdovecot%2Fcore.git script-login: If we fail to finish, exit with 0 to avoid master logging error unnecessarily. --- diff --git a/src/util/script-login.c b/src/util/script-login.c index 61368837c4..40d2b2bc25 100644 --- a/src/util/script-login.c +++ b/src/util/script-login.c @@ -177,12 +177,19 @@ static void script_execute_finish(void) } 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[])