summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-service.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-01-17 21:54:41 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-01-17 21:54:41 +0000
commit6cba32a71da4d64f39ce8d54e2504b215c3f054d (patch)
treeded87530e9b84f65df0dfe3a6cf71ccd247a4ec6 /hcid/dbus-service.c
parent7e3928fe606cb2f753d80c5b6b6e163f1ee8bd49 (diff)
Start autostarted services in idle callback
Diffstat (limited to 'hcid/dbus-service.c')
-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;
}