From 6cba32a71da4d64f39ce8d54e2504b215c3f054d Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 17 Jan 2007 21:54:41 +0000 Subject: Start autostarted services in idle callback --- hcid/dbus-service.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index f9b2b3fd..4d416929 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -1014,6 +1014,21 @@ static void service_notify(int action, const char *name, void *user_data) } } +static gboolean startup_services(gpointer user_data) +{ + GSList *l; + + for (l = services; l != NULL; l = l->next) { + struct service *service = l->data; + + if (service->autostart) + start_service(service, get_dbus_connection()); + + } + + return FALSE; +} + int init_services(const char *path) { DIR *d; @@ -1050,15 +1065,14 @@ int init_services(const char *path) service_free(service); continue; } - - if (service->autostart) - start_service(service, get_dbus_connection()); } closedir(d); notify_add(path, service_notify, NULL); + g_idle_add(startup_services, NULL); + return 0; } -- cgit