diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-05-02 20:40:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-05-02 20:40:54 +0200 |
commit | 5c6c275e43bb5944c271976ef2f67070c54362ae (patch) | |
tree | 2a5c3eb3d200b355bd8c80ceaa2b51a78b864a90 /src/core/unit.c | |
parent | 8ad54a01825f962458cfac9e5a62e7268ac2fa05 (diff) | |
parent | 133e5b362f862ac9c9b1dd7b5de0b004cbb9af54 (diff) |
Merge pull request #3162 from keszybz/alias-refusal
Refuse Alias, DefaultInstance, templated units in install (as appropriate)
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index 64466e4fb4..4ace6b075b 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -193,7 +193,7 @@ int unit_add_name(Unit *u, const char *text) { if (r < 0) return r; - if (i && unit_vtable[t]->no_instances) + if (i && !unit_type_may_template(t)) return -EINVAL; /* Ensure that this unit is either instanced or not instanced, @@ -202,7 +202,7 @@ int unit_add_name(Unit *u, const char *text) { if (u->type != _UNIT_TYPE_INVALID && !u->instance != !i) return -EINVAL; - if (unit_vtable[t]->no_alias && !set_isempty(u->names)) + if (!unit_type_may_alias(t) && !set_isempty(u->names)) return -EEXIST; if (hashmap_size(u->manager->units) >= MANAGER_MAX_NAMES) @@ -720,7 +720,7 @@ int unit_merge(Unit *u, Unit *other) { if (!u->instance != !other->instance) return -EINVAL; - if (UNIT_VTABLE(u)->no_alias) /* Merging only applies to unit names that support aliases */ + if (!unit_type_may_alias(u->type)) /* Merging only applies to unit names that support aliases */ return -EEXIST; if (other->load_state != UNIT_STUB && |