From: Michael Tremer Date: Wed, 25 Jun 2025 09:45:59 +0000 (+0000) Subject: cli: auth: Use the new ready callback X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0fb09734ab317508108b5b9381534c149a828b2;p=pakfire.git cli: auth: Use the new ready callback Signed-off-by: Michael Tremer --- diff --git a/src/cli/lib/auth.c b/src/cli/lib/auth.c index f245a43a..56d80ba4 100644 --- a/src/cli/lib/auth.c +++ b/src/cli/lib/auth.c @@ -55,12 +55,11 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) { return 0; } -static int auth_callback(struct pakfire_client* client, - pakfire_client_auth_status status, void* data) { +static int ready_callback(struct pakfire_client* client, void* data) { int* r = data; - // Set the status - *r = status; + // If we get here, we set the status to zero + *r = 0; return 0; } @@ -69,7 +68,7 @@ int cli_auth(void* data, int argc, char* argv[]) { struct cli_global_args* global_args = data; struct cli_local_args local_args = {}; struct pakfire_client* client = NULL; - int status = 0; + int status = 1; int r; // Parse the command line @@ -82,10 +81,8 @@ int cli_auth(void* data, int argc, char* argv[]) { if (r < 0) goto ERROR; - // Set the authentication callback - r = pakfire_client_set_auth_callback(client, auth_callback, &status); - if (r < 0) - goto ERROR; + // Set the ready callback + pakfire_client_set_ready_callback(client, ready_callback, &status); // Authenticate r = pakfire_client_auth_user(client, local_args.username, local_args.password);