chiark / gitweb /
swap: major rework, use /sbin/swapon for setting up swaps, fix merging of aliased...
[elogind.git] / src / unit.c
index d2652bafb2e9982a0e7f3e62091faf97a5c32fa2..9fc9be5c79a1810dc940cb3f3147f4ac10464589 100644 (file)
@@ -103,7 +103,7 @@ int unit_add_name(Unit *u, const char *text) {
         if (!s)
                 return -ENOMEM;
 
-        if (!unit_name_is_valid(s)) {
+        if (!unit_name_is_valid(s, false)) {
                 r = -EINVAL;
                 goto fail;
         }
@@ -376,7 +376,6 @@ void unit_free(Unit *u) {
         set_free_free(u->meta.names);
 
         free(u->meta.instance);
-
         free(u);
 }
 
@@ -2222,14 +2221,14 @@ UnitType unit_name_to_type(const char *n) {
         return _UNIT_TYPE_INVALID;
 }
 
-bool unit_name_is_valid(const char *n) {
+bool unit_name_is_valid(const char *n, bool template_ok) {
         UnitType t;
 
         t = unit_name_to_type(n);
         if (t < 0 || t >= _UNIT_TYPE_MAX)
                 return false;
 
-        return unit_name_is_valid_no_type(n);
+        return unit_name_is_valid_no_type(n, template_ok);
 }
 
 static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = {
@@ -2237,7 +2236,7 @@ static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = {
         [UNIT_LOADED] = "loaded",
         [UNIT_ERROR] = "error",
         [UNIT_MERGED] = "merged",
-        [UNIT_BANNED] = "banned"
+        [UNIT_MASKED] = "masked"
 };
 
 DEFINE_STRING_TABLE_LOOKUP(unit_load_state, UnitLoadState);