chiark / gitweb /
tests: add tests for environment serialization
[elogind.git] / src / basic / unit-name.c
index 6e6bd3bdb8aaee0642e51e8d755b0ad1cbdb0967..fb30c2527a5e40f3ca5891fcc64fa8aa78c440d0 100644 (file)
@@ -275,7 +275,7 @@ int unit_name_build(const char *prefix, const char *instance, const char *suffix
         if (!instance)
                 s = strappend(prefix, suffix);
         else
-                s = strjoin(prefix, "@", instance, suffix, NULL);
+                s = strjoin(prefix, "@", instance, suffix);
         if (!s)
                 return -ENOMEM;
 
@@ -557,7 +557,7 @@ int unit_name_from_path_instance(const char *prefix, const char *path, const cha
         if (r < 0)
                 return r;
 
-        s = strjoin(prefix, "@", p, suffix, NULL);
+        s = strjoin(prefix, "@", p, suffix);
         if (!s)
                 return -ENOMEM;
 
@@ -761,7 +761,7 @@ int slice_build_parent_slice(const char *slice, char **ret) {
         else {
                 r = free_and_strdup(&s, "-.slice");
                 if (r < 0) {
-                free(s);
+                        free(s);
                         return r;
                 }
         }
@@ -1053,3 +1053,12 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = {
 
 DEFINE_STRING_TABLE_LOOKUP(unit_dependency, UnitDependency);
 #endif // 0
+
+static const char* const notify_access_table[_NOTIFY_ACCESS_MAX] = {
+        [NOTIFY_NONE] = "none",
+        [NOTIFY_MAIN] = "main",
+        [NOTIFY_EXEC] = "exec",
+        [NOTIFY_ALL] = "all"
+};
+
+DEFINE_STRING_TABLE_LOOKUP(notify_access, NotifyAccess);