]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
script-login: If we fail to finish, exit with 0 to avoid master logging error unneces...
authorTimo Sirainen <tss@iki.fi>
Fri, 20 Jan 2012 15:42:15 +0000 (17:42 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 20 Jan 2012 15:42:15 +0000 (17:42 +0200)
src/util/script-login.c

index 61368837c45c58904b73b61fe91679253b633acf..40d2b2bc2598bdf3842f78bc33d8b443466771ab 100644 (file)
@@ -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[])