public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH Bluez] obexd: agent: Use if-elseif instead of multi-if to check error message
@ 2023-04-21  2:47 Guiting Shen
  2023-04-21  4:13 ` [Bluez] " bluez.test.bot
  2023-04-21 21:10 ` [PATCH Bluez] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Guiting Shen @ 2023-04-21  2:47 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Guiting Shen

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(-)

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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-21 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-21  2:47 [PATCH Bluez] obexd: agent: Use if-elseif instead of multi-if to check error message Guiting Shen
2023-04-21  4:13 ` [Bluez] " bluez.test.bot
2023-04-21 21:10 ` [PATCH Bluez] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox