Return error in case of service searches

This commit is contained in:
Marcel Holtmann 2007-01-19 03:05:28 +00:00
parent 547e6b74a5
commit 819e5e4a8b
2 changed files with 8 additions and 12 deletions

View File

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

View File

@ -21,4 +21,6 @@
*
*/
#define ERROR_INTERFACE "org.bluez.Error"
#define SYSTEM_PATH "/org/bluez"