diff options
Diffstat (limited to 'hcid/manager.c')
-rw-r--r-- | hcid/manager.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/hcid/manager.c b/hcid/manager.c index d470e53b..c4288278 100644 --- a/hcid/manager.c +++ b/hcid/manager.c @@ -312,8 +312,10 @@ static DBusHandlerResult list_services(DBusConnection *conn, static DBusHandlerResult activate_service(DBusConnection *conn, DBusMessage *msg, void *data) { + DBusMessage *reply; const char *pattern; struct service *service; + const char *busname = "org.bluez"; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &pattern, @@ -324,29 +326,14 @@ static DBusHandlerResult activate_service(DBusConnection *conn, if (!service) return error_no_such_service(conn, msg); - if (service->bus_name) { - DBusMessage *reply; - - reply = dbus_message_new_method_return(msg); - if (!reply) - return DBUS_HANDLER_RESULT_NEED_MEMORY; - - dbus_message_append_args(reply, - DBUS_TYPE_STRING, &service->bus_name, - DBUS_TYPE_INVALID); - - return send_message_and_unref(conn, reply); - } - - if (service->pid) - return error_service_start_in_progress(conn, msg); - - if (service_start(service, conn) < 0) - return error_failed_errno(conn, msg, ENOEXEC); + reply = dbus_message_new_method_return(msg); + if (!reply) + return DBUS_HANDLER_RESULT_NEED_MEMORY; - service->action = dbus_message_ref(msg); + dbus_message_append_args(reply, DBUS_TYPE_STRING, &busname, + DBUS_TYPE_INVALID); - return DBUS_HANDLER_RESULT_HANDLED; + return send_message_and_unref(conn, reply); } static DBusMethodVTable old_manager_methods[] = { |