]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth, lib-program-client: Silence prototype conflicts
authorChristian Göttsche <cgzones@googlemail.com>
Fri, 15 Sep 2023 12:08:56 +0000 (14:08 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 25 Sep 2023 10:38:50 +0000 (13:38 +0300)
    program-client.c:705:5: warning: conflicting types for 'program_client_run' due to enum/integer mismatch; have 'int(struct program_client *)' [-Wenum-int-mismatch]
      705 | int program_client_run(struct program_client *pclient)
          |     ^~~~~~~~~~~~~~~~~~
    In file included from program-client-private.h:4,
                     from program-client.c:17:
    program-client.h:93:1: note: previous declaration of 'program_client_run' with type 'enum program_client_exit_status(struct program_client *)'
       93 | program_client_run(struct program_client *pclient);
          | ^~~~~~~~~~~~~~~~~~

    db-lua.c:599:1: warning: conflicting types for 'auth_lua_call_password_verify' due to enum/integer mismatch; have 'enum passdb_result(struct dlua_script *, struct auth_request *, const char *, const char **)' [-Wenum-int-mismatch]
      599 | auth_lua_call_password_verify(struct dlua_script *script,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from db-lua.c:28:
    db-lua.h:14:5: note: previous declaration of 'auth_lua_call_password_verify' with type 'int(struct dlua_script *, struct auth_request *, const char *, const char **)'
       14 | int auth_lua_call_password_verify(struct dlua_script *script,
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/auth/db-lua.h
src/lib-program-client/program-client.c

index cccc8d59c7371c09ba0e49a3b40e7f77b2228ff9..30993aacdbf0be1cd29fe9da178a79fbf460aafc 100644 (file)
@@ -23,9 +23,10 @@ struct auth_lua_script_parameters {
 int auth_lua_script_init(const struct auth_lua_script_parameters *params,
                         const char **error_r);
 
-int auth_lua_call_password_verify(struct dlua_script *script,
-                                 struct auth_request *req, const char *password,
-                                 const char **error_r);
+enum passdb_result
+auth_lua_call_password_verify(struct dlua_script *script,
+                             struct auth_request *req, const char *password,
+                             const char **error_r);
 
 enum passdb_result
 auth_lua_call_passdb_lookup(struct dlua_script *script,
index f85dda3cfdefa31f7b8811bb34279659202d3e0e..a2157d00cbd322e88a267c4d0caf50aed82ea147 100644 (file)
@@ -706,7 +706,7 @@ program_client_run_callback(int result, int *context)
        io_loop_stop(current_ioloop);
 }
 
-int program_client_run(struct program_client *pclient)
+enum program_client_exit_status program_client_run(struct program_client *pclient)
 {
        int ret = -2;
        struct ioloop *prev_ioloop = current_ioloop;
@@ -726,7 +726,7 @@ int program_client_run(struct program_client *pclient)
        io_loop_destroy(&ioloop);
 
        if (pclient->error != PROGRAM_CLIENT_ERROR_NONE)
-               return -1;
+               return PROGRAM_CLIENT_EXIT_STATUS_INTERNAL_FAILURE;
 
        return pclient->exit_status;
 }