From 9a0acc7984ef79e287ec9db70703405f64a79bee Mon Sep 17 00:00:00 2001 From: Guiting Shen Date: Fri, 21 Apr 2023 10:47:31 +0800 Subject: obexd: agent: Use if-elseif instead of multi-if to check error message The obex agent will return only one error message at the same time.So we should use if-elseif instead of multi-if to check error message which maybe DEBUG_ERROR_NO_REPLY or OBEX_ERROR_REJECT in agent_reply(). --- obexd/src/manager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'obexd') diff --git a/obexd/src/manager.c b/obexd/src/manager.c index 2bb985b96..73fd6b9af 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -632,8 +632,7 @@ static void agent_reply(DBusPendingCall *call, void *user_data) if (dbus_error_has_name(&derr, DBUS_ERROR_NO_REPLY)) agent_cancel(); - - if (dbus_error_has_name(&derr, OBEX_ERROR_REJECT)) + else if (dbus_error_has_name(&derr, OBEX_ERROR_REJECT)) agent->auth_reject = TRUE; dbus_error_free(&derr); -- cgit v1.2.1