From: Karl Fleischmann Date: Mon, 7 Feb 2022 08:19:04 +0000 (+0100) Subject: welcome: Use program_client_exit_status enum value X-Git-Tag: 2.4.0~4566 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=488e96171c0da56ef842ef2bca6c71681bc7afb3;p=thirdparty%2Fdovecot%2Fcore.git welcome: Use program_client_exit_status enum value Replace the implicit int with the explicit program_client_exit_status enum value when starting the script and handling the callback. --- diff --git a/src/plugins/welcome/welcome-plugin.c b/src/plugins/welcome/welcome-plugin.c index a4fa1c4b48..ca39121044 100644 --- a/src/plugins/welcome/welcome-plugin.c +++ b/src/plugins/welcome/welcome-plugin.c @@ -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 {