--- activation.c.~1.34.~ 2004-03-16 19:00:34.000000000 +0100 +++ activation.c 2004-07-22 17:09:19.754538391 +0200 @@ -1319,40 +1319,46 @@ if (!entry) return FALSE; - /* Check if the service is active */ - _dbus_string_init_const (&service_str, service_name); - if (bus_registry_lookup (bus_context_get_registry (activation->context), &service_str) != NULL) + /* Bypass the registry lookup if we're auto-activating, bus_dispatch would not + * call us if the service is already active. + */ + if (!auto_activation) { - _dbus_verbose ("Service \"%s\" is already active\n", service_name); + /* Check if the service is active */ + _dbus_string_init_const (&service_str, service_name); + if (bus_registry_lookup (bus_context_get_registry (activation->context), &service_str) != NULL) + { + _dbus_verbose ("Service \"%s\" is already active\n", service_name); - message = dbus_message_new_method_return (activation_message); + message = dbus_message_new_method_return (activation_message); - if (!message) - { - _dbus_verbose ("No memory to create reply to activate message\n"); - BUS_SET_OOM (error); - return FALSE; - } + if (!message) + { + _dbus_verbose ("No memory to create reply to activate message\n"); + BUS_SET_OOM (error); + return FALSE; + } - if (!dbus_message_append_args (message, - DBUS_TYPE_UINT32, DBUS_ACTIVATION_REPLY_ALREADY_ACTIVE, - DBUS_TYPE_INVALID)) - { - _dbus_verbose ("No memory to set args of reply to activate message\n"); - BUS_SET_OOM (error); - dbus_message_unref (message); - return FALSE; - } + if (!dbus_message_append_args (message, + DBUS_TYPE_UINT32, DBUS_ACTIVATION_REPLY_ALREADY_ACTIVE, + DBUS_TYPE_INVALID)) + { + _dbus_verbose ("No memory to set args of reply to activate message\n"); + BUS_SET_OOM (error); + dbus_message_unref (message); + return FALSE; + } - retval = bus_transaction_send_from_driver (transaction, connection, message); - dbus_message_unref (message); - if (!retval) - { - _dbus_verbose ("Failed to send reply\n"); - BUS_SET_OOM (error); - } + retval = bus_transaction_send_from_driver (transaction, connection, message); + dbus_message_unref (message); + if (!retval) + { + _dbus_verbose ("Failed to send reply\n"); + BUS_SET_OOM (error); + } - return retval; + return retval; + } } pending_activation_entry = dbus_new0 (BusPendingActivationEntry, 1); @@ -1505,10 +1511,7 @@ */ if (activated == TRUE) - { - pending_activation->babysitter = NULL; - return TRUE; - } + return TRUE; /* Now try to spawn the process */ argv[0] = entry->exec;