summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-19 03:05:28 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-19 03:05:28 +0000
commit819e5e4a8b5b71d6ac676f3a869b8cf290192657 (patch)
treee3e8d1f4abf89c3ba6c287edb23ee05124bdbc93 /daemon
parent547e6b74a5feb2a18f3f4067fe265010bead8a10 (diff)
Return error in case of service searches
Diffstat (limited to 'daemon')
-rw-r--r--daemon/service.c18
-rw-r--r--daemon/system.h2
2 files changed, 8 insertions, 12 deletions
diff --git a/daemon/service.c b/daemon/service.c
index f3f43a0d..b56087c4 100644
--- a/daemon/service.c
+++ b/daemon/service.c
@@ -67,13 +67,10 @@ DBusMessage *service_find(DBusMessage *msg)
debug("Searching service with pattern \"%s\"", pattern);
- reply = dbus_message_new_method_return(msg);
- if (!reply)
- return NULL;
+ reply = dbus_message_new_error(msg, ERROR_INTERFACE ".NotFound",
+ "Service does not exists");
- dbus_message_append_args(reply, DBUS_TYPE_INVALID);
-
- return 0;
+ return reply;
}
DBusMessage *service_activate(DBusMessage *msg)
@@ -86,13 +83,10 @@ DBusMessage *service_activate(DBusMessage *msg)
debug("Activating service with pattern \"%s\"", pattern);
- reply = dbus_message_new_method_return(msg);
- if (!reply)
- return NULL;
+ reply = dbus_message_new_error(msg, ERROR_INTERFACE ".NotFound",
+ "Service does not exists");
- dbus_message_append_args(reply, DBUS_TYPE_INVALID);
-
- return 0;
+ return reply;
}
static void config_notify(int action, const char *name, void *data)
diff --git a/daemon/system.h b/daemon/system.h
index 910ca3c1..05f92374 100644
--- a/daemon/system.h
+++ b/daemon/system.h
@@ -21,4 +21,6 @@
*
*/
+#define ERROR_INTERFACE "org.bluez.Error"
+
#define SYSTEM_PATH "/org/bluez"