obexd: agent: Use if-elseif instead of multi-if to check error message
authorGuiting Shen <aarongt.shen@gmail.com>
Fri, 21 Apr 2023 02:47:31 +0000 (10:47 +0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 10:41:34 +0000 (16:11 +0530)
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

index 22000d8..5c9f532 100755 (executable)
@@ -765,8 +765,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);