From 2250539aeee0569f8861841d1f5ff16f1539715e Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 5 Apr 2003 19:03:40 +0000 Subject: 2003-04-05 Havoc Pennington * bus/loop.c (bus_loop_iterate): fix the timeout code, using magic from GLib * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid to -1 once we've reaped the babysitter (_dbus_babysitter_handle_watch): do as much work as we can, not just one go of it * bus/activation.c: add code using DBusBabysitter so that we handle it when a service fails to start up properly. (bus_activation_service_created): don't remove the activation entries as we go, just let them get removed when we free the pending activation. Unref reply messages after sending them. --- bus/bus.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bus/bus.c') diff --git a/bus/bus.c b/bus/bus.c index 9125fc75..5ae77d62 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -47,6 +47,7 @@ struct BusContext DBusList *mandatory_rules; /**< Mandatory policy rules */ DBusHashTable *rules_by_uid; /**< per-UID policy rules */ DBusHashTable *rules_by_gid; /**< per-GID policy rules */ + int activation_timeout; /**< How long to wait for an activation to time out */ }; static int server_data_slot = -1; @@ -333,6 +334,12 @@ bus_context_new (const DBusString *config_file, context->refcount = 1; +#ifdef DBUS_BUILD_TESTS + context->activation_timeout = 6000; /* 6/10 second */ /* FIXME */ +#else + context->activation_timeout = 10000; /* 10 seconds */ +#endif + context->loop = bus_loop_new (); if (context->loop == NULL) { @@ -853,3 +860,10 @@ bus_context_create_connection_policy (BusContext *context, bus_policy_unref (policy); return NULL; } + +int +bus_context_get_activation_timeout (BusContext *context) +{ + + return context->activation_timeout; +} -- cgit