summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-21 18:02:00 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-21 18:02:00 +0000
commit2bdadb9a01d23b0118161dfc598cc688ef5719e5 (patch)
treef046fcb1db7fbc6612251491ce3b9a8ba7ed8971
parent75eb97849ccc85e25ca303c90e0fa4ccb03cad2f (diff)
input: added already connected error
-rw-r--r--input/device.c2
-rw-r--r--input/error.c8
-rw-r--r--input/error.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/input/device.c b/input/device.c
index 5f70ede1..45c7fa4a 100644
--- a/input/device.c
+++ b/input/device.c
@@ -801,7 +801,7 @@ static DBusHandlerResult device_connect(DBusConnection *conn,
return err_connection_failed(conn, msg, "Connection in progress");
if (is_connected(idev))
- return err_connection_failed(conn, msg, "Already connected");
+ return err_already_connected(conn, msg);
idev->pending_connect = g_try_new0(struct pending_connect, 1);
if (!idev->pending_connect) {
diff --git a/input/error.c b/input/error.c
index 658bdeff..24492ae2 100644
--- a/input/error.c
+++ b/input/error.c
@@ -66,6 +66,14 @@ DBusHandlerResult err_connection_failed(DBusConnection *conn,
str));
}
+DBusHandlerResult err_already_connected(DBusConnection *conn, DBusMessage *msg)
+{
+ return send_message_and_unref(conn,
+ dbus_message_new_error(msg,
+ INPUT_ERROR_INTERFACE ".AlreadyConnected",
+ "Already connected to this device"));
+}
+
DBusHandlerResult err_already_exists(DBusConnection *conn,
DBusMessage *msg, const char *str)
{
diff --git a/input/error.h b/input/error.h
index f5f4c757..45981be5 100644
--- a/input/error.h
+++ b/input/error.h
@@ -33,6 +33,8 @@ DBusHandlerResult err_failed(DBusConnection *conn, DBusMessage *msg,
DBusHandlerResult err_connection_failed(DBusConnection *conn,
DBusMessage *msg, const char *str);
+DBusHandlerResult err_already_connected(DBusConnection *conn, DBusMessage *msg);
+
DBusHandlerResult err_already_exists(DBusConnection *conn,
DBusMessage *msg, const char *str);