void unit_add_to_load_queue(Unit *u) {
assert(u);
+ assert(u->meta.type != _UNIT_TYPE_INVALID);
if (u->meta.load_state != UNIT_STUB || u->meta.in_load_queue)
return;
void unit_add_to_dbus_queue(Unit *u) {
assert(u);
+ assert(u->meta.type != _UNIT_TYPE_INVALID);
if (u->meta.load_state == UNIT_STUB || u->meta.in_dbus_queue || set_isempty(u->meta.manager->subscribed))
return;
other->meta.load_state != UNIT_FAILED)
return -EEXIST;
+ if (other->meta.job)
+ return -EEXIST;
+
+ if (unit_active_state(other) != UNIT_INACTIVE)
+ return -EEXIST;
+
/* Merge names */
merge_names(u, other);