In commit:
075945f6 (John (J5) Palmieri 2005-07-14 20:44:15 +0000
some code was added to compare services by Exec key. The changelog is
not pariticularly informative as to why this was added. But while
debugging other code, we noticed this.
Comparing by Exec key is not in the specification, and triggered a
problem where while converting services to use systemd for activation,
a change was made to use Exec=/bin/false and simply rely on systemd
to activate.
While I think it was broken for the service files to be changed
to Exec=/bin/false, we shouldn't be doing something here that's
not in the spec either.
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35750
int argc;
dbus_bool_t retval;
DBusHashIter iter;
int argc;
dbus_bool_t retval;
DBusHashIter iter;
+ dbus_bool_t was_pending_activation;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
if (activation->n_pending_activations >=
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
if (activation->n_pending_activations >=
/* Check if the service is being activated */
pending_activation = _dbus_hash_table_lookup_string (activation->pending_activations, service_name);
/* Check if the service is being activated */
pending_activation = _dbus_hash_table_lookup_string (activation->pending_activations, service_name);
- if (pending_activation)
+ was_pending_activation = (pending_activation != NULL);
+ if (was_pending_activation)
{
if (!_dbus_list_append (&pending_activation->entries, pending_activation_entry))
{
{
if (!_dbus_list_append (&pending_activation->entries, pending_activation_entry))
{
pending_activation->n_entries += 1;
pending_activation->activation->n_pending_activations += 1;
pending_activation->n_entries += 1;
pending_activation->activation->n_pending_activations += 1;
- activated = FALSE;
- _dbus_hash_iter_init (activation->pending_activations, &iter);
- while (_dbus_hash_iter_next (&iter))
- {
- BusPendingActivation *p = _dbus_hash_iter_get_value (&iter);
-
- if (strcmp (p->exec, entry->exec) == 0)
- {
- activated = TRUE;
- break;
- }
- }
-
if (!_dbus_hash_table_insert_string (activation->pending_activations,
pending_activation->service_name,
pending_activation))
if (!_dbus_hash_table_insert_string (activation->pending_activations,
pending_activation->service_name,
pending_activation))
+ if (was_pending_activation)
return TRUE;
if (bus_context_get_systemd_activation (activation->context))
return TRUE;
if (bus_context_get_systemd_activation (activation->context))