summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hcid/dbus-service.c20
1 files 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;
}