diff options
author | Guiting Shen <aarongt.shen@gmail.com> | 2023-04-21 10:47:31 +0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-04-21 14:06:13 -0700 |
commit | 9a0acc7984ef79e287ec9db70703405f64a79bee (patch) | |
tree | e191cb1f4701de21bc72300a6579368a8025a601 | |
parent | d361604594048b1a4df370b969f9d5140c832d30 (diff) | |
download | bluez-9a0acc7984ef79e287ec9db70703405f64a79bee.tar.gz |
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().
-rw-r--r-- | obexd/src/manager.c | 3 |
1 files changed, 1 insertions, 2 deletions
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); |