]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/path.c
Merge pull request #15697 from OhNoMoreGit/fix-path-units
[thirdparty/systemd.git] / src / core / path.c
index a98a0a14e96fb55be0255ae33c3a6b615fa5ae05..1c3c28e34172c2b5484ded964e723283da82f969 100644 (file)
@@ -221,11 +221,10 @@ static void path_spec_mkdir(PathSpec *s, mode_t mode) {
 }
 
 static void path_spec_dump(PathSpec *s, FILE *f, const char *prefix) {
-        fprintf(f,
-                "%s%s: %s\n",
-                prefix,
-                path_type_to_string(s->type),
-                s->path);
+        const char *type;
+
+        assert_se(type = path_type_to_string(s->type));
+        fprintf(f, "%s%s: %s\n", prefix, type, s->path);
 }
 
 void path_spec_done(PathSpec *s) {
@@ -609,14 +608,16 @@ static int path_serialize(Unit *u, FILE *f, FDSet *fds) {
         (void) serialize_item(f, "result", path_result_to_string(p->result));
 
         LIST_FOREACH(spec, s, p->specs) {
+                const char *type;
                 _cleanup_free_ char *escaped = NULL;
 
                 escaped = cescape(s->path);
                 if (!escaped)
                         return log_oom();
 
+                assert_se(type = path_type_to_string(s->type));
                 (void) serialize_item_format(f, "path-spec", "%s %i %s",
-                                             path_type_to_string(s->type),
+                                             type,
                                              s->previous_exists,
                                              escaped);
         }
@@ -827,6 +828,5 @@ const UnitVTable path_vtable = {
 
         .reset_failed = path_reset_failed,
 
-        .bus_vtable = bus_path_vtable,
         .bus_set_property = bus_path_set_property,
 };