public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 3/7] convert errors to btd_error_does_not_exist()
Date: Wed,  8 Dec 2010 18:25:57 -0200	[thread overview]
Message-ID: <1291839961-14940-3-git-send-email-padovan@profusion.mobi> (raw)
In-Reply-To: <1291839961-14940-2-git-send-email-padovan@profusion.mobi>

---
 audio/gateway.c   |    4 +---
 audio/media.c     |    3 +--
 plugins/service.c |    2 +-
 src/device.c      |    4 +---
 4 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/audio/gateway.c b/audio/gateway.c
index 7aec623..05b9ff7 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -522,9 +522,7 @@ static DBusMessage *unregister_agent(DBusConnection *conn,
 		return btd_error_invalid_args(msg);
 
 	if (strcmp(gw->agent->path, path) != 0)
-		return g_dbus_create_error(msg,
-				ERROR_INTERFACE ".Failed",
-				"Unknown object path");
+		return btd_error_does_not_exist(msg);
 
 	g_dbus_remove_watch(device->conn, gw->agent->watch);
 
diff --git a/audio/media.c b/audio/media.c
index b893231..0e6ccc9 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -351,8 +351,7 @@ static DBusMessage *unregister_endpoint(DBusConnection *conn, DBusMessage *msg,
 
 	endpoint = media_adapter_find_endpoint(adapter, sender, path, NULL);
 	if (endpoint == NULL)
-		return g_dbus_create_error(msg, ERROR_INTERFACE ".Failed",
-				"Endpoint not registered");
+		return btd_error_does_not_exist(msg);
 
 	media_endpoint_remove(endpoint);
 
diff --git a/plugins/service.c b/plugins/service.c
index 5267671..a442d53 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -600,7 +600,7 @@ static DBusMessage *request_authorization(DBusConnection *conn,
 
 	sender = dbus_message_get_sender(msg);
 	if (find_pending_by_sender(serv_adapter, sender))
-		return failed(msg);
+		return btd_error_does_not_exist(msg);
 
 	user_record = find_record(serv_adapter, handle, sender);
 	if (!user_record) {
diff --git a/src/device.c b/src/device.c
index 1b8d581..cc8131b 100644
--- a/src/device.c
+++ b/src/device.c
@@ -723,9 +723,7 @@ static DBusMessage *cancel_discover(DBusConnection *conn,
 	const char *requestor;
 
 	if (!device->browse)
-		return g_dbus_create_error(msg,
-				ERROR_INTERFACE ".Failed",
-				"No pending discovery");
+		return btd_error_does_not_exist(msg);
 
 	if (!dbus_message_is_method_call(device->browse->msg, DEVICE_INTERFACE,
 					"DiscoverServices"))
-- 
1.7.3.2


  reply	other threads:[~2010-12-08 20:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08 20:25 [PATCH 1/7] Fix coding styling issues in src/error.c Gustavo F. Padovan
2010-12-08 20:25 ` [PATCH 2/7] convert errors to btd_error_not_authorized() Gustavo F. Padovan
2010-12-08 20:25   ` Gustavo F. Padovan [this message]
2010-12-08 20:25     ` [PATCH 4/7] convert error to btd_error_busy() Gustavo F. Padovan
2010-12-08 20:25       ` [PATCH 5/7] convert error to btd_error_not_connected() Gustavo F. Padovan
2010-12-08 20:26         ` [PATCH 6/7] convert error to btd_error_not_supported() Gustavo F. Padovan
2010-12-08 20:26           ` [PATCH 7/7] Add btd_error_already_connected() Gustavo F. Padovan
2010-12-08 20:58 ` [PATCH 1/7] Fix coding styling issues in src/error.c Johan Hedberg

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=1291839961-14940-3-git-send-email-padovan@profusion.mobi \
    --to=padovan@profusion.mobi \
    --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