[PATCH 01/14] neard: Adjust errors to latest API changes

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

 



neard Handover API was stripped of not really usefull error codes.
---
 plugins/neard.c | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/plugins/neard.c b/plugins/neard.c
index b0150e9..6272144 100644
--- a/plugins/neard.c
+++ b/plugins/neard.c
@@ -57,27 +57,14 @@ static gboolean agent_register_postpone = FALSE;
 
 static DBusMessage *error_reply(DBusMessage *msg, int error)
 {
-	switch (error) {
-	case ENOTSUP:
-		return g_dbus_create_error(msg, ERROR_INTERFACE ".NotSupported",
-						"Operation is not supported");
+	const char *name;
 
-	case ENOENT:
-		return g_dbus_create_error(msg, ERROR_INTERFACE ".NoSuchDevice",
-							"No such device");
-
-	case EINPROGRESS:
-		return g_dbus_create_error(msg, ERROR_INTERFACE ".InProgress",
-						"Operation already in progress");
-
-	case ENONET:
-		return g_dbus_create_error(msg, ERROR_INTERFACE ".Disabled",
-							"Device disabled");
+	if (error == EINPROGRESS)
+		name = ERROR_INTERFACE ".InProgress";
+	else
+		name = ERROR_INTERFACE ".Failed";
 
-	default:
-		return g_dbus_create_error(msg, ERROR_INTERFACE ".Failed",
-							"%s", strerror(error));
-	}
+	return g_dbus_create_error(msg, name , "%s", strerror(error));
 }
 
 static void register_agent_cb(DBusPendingCall *call, void *user_data)
-- 
1.8.1.1

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