public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Guiting Shen <aarongt.shen@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Guiting Shen <aarongt.shen@gmail.com>
Subject: [PATCH Bluez] obexd: agent: Use if-elseif instead of multi-if to check error message
Date: Fri, 21 Apr 2023 10:47:31 +0800	[thread overview]
Message-ID: <20230421024731.42130-1-aarongt.shen@gmail.com> (raw)

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


             reply	other threads:[~2023-04-21  2:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21  2:47 Guiting Shen [this message]
2023-04-21  4:13 ` [Bluez] obexd: agent: Use if-elseif instead of multi-if to check error message bluez.test.bot
2023-04-21 21:10 ` [PATCH Bluez] " patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230421024731.42130-1-aarongt.shen@gmail.com \
    --to=aarongt.shen@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox