[PATCH 5/7] convert error to btd_error_not_connected()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 network/connection.c |    8 +-------
 serial/port.c        |    2 +-
 src/device.c         |    4 +---
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/network/connection.c b/network/connection.c
index 37a7511..d24d96c 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -123,12 +123,6 @@ static inline DBusMessage *already_connected(DBusMessage *msg)
 						"Device already connected");
 }
 
-static inline DBusMessage *not_connected(DBusMessage *msg)
-{
-	return g_dbus_create_error(msg, ERROR_INTERFACE ".Failed",
-						"Device not connected");
-}
-
 static inline DBusMessage *not_permited(DBusMessage *msg)
 {
 	return g_dbus_create_error(msg, ERROR_INTERFACE ".Failed",
@@ -460,7 +454,7 @@ static DBusMessage *connection_disconnect(DBusConnection *conn,
 		return connection_cancel(conn, msg, nc);
 	}
 
-	return not_connected(msg);
+	return btd_error_not_connected(msg);
 }
 
 static DBusMessage *connection_get_properties(DBusConnection *conn,
diff --git a/serial/port.c b/serial/port.c
index 1d0bfc1..0d1e600 100644
--- a/serial/port.c
+++ b/serial/port.c
@@ -533,7 +533,7 @@ static DBusMessage *port_disconnect(DBusConnection *conn,
 		return btd_error_does_not_exist(msg);
 
 	if (!port->listener_id)
-		return failed(msg, "Not connected");
+		return btd_error_not_connected(msg);
 
 	owner = dbus_message_get_sender(port->msg);
 	caller = dbus_message_get_sender(msg);
diff --git a/src/device.c b/src/device.c
index cc8131b..91b9d23 100644
--- a/src/device.c
+++ b/src/device.c
@@ -799,9 +799,7 @@ static DBusMessage *disconnect(DBusConnection *conn, DBusMessage *msg,
 	struct btd_device *device = user_data;
 
 	if (!device->handle)
-		return g_dbus_create_error(msg,
-				ERROR_INTERFACE ".NotConnected",
-				"Device is not connected");
+		return btd_error_not_connected(msg);
 
 	device_request_disconnect(device, msg);
 
-- 
1.7.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux