]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
welcome: Use program_client_exit_status enum value
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Mon, 7 Feb 2022 08:19:04 +0000 (09:19 +0100)
committerKarl Fleischmann <karl.fleischmann@open-xchange.com>
Mon, 7 Feb 2022 13:04:50 +0000 (14:04 +0100)
Replace the implicit int with the explicit program_client_exit_status
enum value when starting the script and handling the callback.

src/plugins/welcome/welcome-plugin.c

index a4fa1c4b48c70602f8cce859d0afb460e868f4f1..ca391210447e3defd40a865b44d93faa4ed15017 100644 (file)
@@ -37,10 +37,11 @@ static void welcome_client_destroy(struct welcome_client_list **_wclient) {
        i_free(wclient);
 }
 
-static void script_finish(int ret, struct program_client *client ATTR_UNUSED)
+static void script_finish(enum program_client_exit_status ret,
+                         struct program_client *client ATTR_UNUSED)
 {
-       if (ret < 1)
-               i_error("welcome: Execution failed");
+       if (ret != PROGRAM_CLIENT_EXIT_STATUS_SUCCESS)
+               i_error("welcome: Execution failed: %d", ret);
 }
 
 static void script_execute(struct mail_user *user, const char *cmd, bool wait)
@@ -72,7 +73,8 @@ static void script_execute(struct mail_user *user, const char *cmd, bool wait)
        wclient->client = program_client_unix_create(socket_path, args, &set, TRUE);
 
        if (wait) {
-               int ret = program_client_run(wclient->client);
+               enum program_client_exit_status ret =
+                       program_client_run(wclient->client);
                script_finish(ret, wclient->client);
                welcome_client_destroy(&wclient);
        } else {