From 6be1e7d538e12f4e5c79c1271dba90e66726d8fd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 14 Feb 2010 01:01:10 +0100 Subject: [PATCH 1/1] unit: rename load_path to fragment_path to make clear what kind of configuration file this is --- dbus-unit.c | 4 ++-- load-fragment.c | 8 ++++---- manager.c | 2 +- systemadm.vala | 12 ++++++------ systemd-interfaces.vala | 2 +- unit.c | 6 +++--- unit.h | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dbus-unit.c b/dbus-unit.c index f48433b60..00374e7fa 100644 --- a/dbus-unit.c +++ b/dbus-unit.c @@ -49,7 +49,7 @@ static const char introspection[] = " " " " " " - " " + " " " " " " " " @@ -217,7 +217,7 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusMessage *message { "org.freedesktop.systemd1.Unit", "Description", bus_unit_append_description, "s", u }, { "org.freedesktop.systemd1.Unit", "LoadState", bus_unit_append_load_state, "s", u }, { "org.freedesktop.systemd1.Unit", "ActiveState", bus_unit_append_active_state, "s", u }, - { "org.freedesktop.systemd1.Unit", "LoadPath", bus_property_append_string, "s", u->meta.load_path }, + { "org.freedesktop.systemd1.Unit", "FragmentPath", bus_property_append_string, "s", u->meta.fragment_path }, { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_property_append_uint64, "t", &u->meta.active_enter_timestamp }, { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp", bus_property_append_uint64, "t", &u->meta.active_exit_timestamp }, { "org.freedesktop.systemd1.Unit", "CanReload", bus_unit_append_can_reload, "b", u }, diff --git a/load-fragment.c b/load-fragment.c index 64e66f314..4183b5c8f 100644 --- a/load-fragment.c +++ b/load-fragment.c @@ -1207,8 +1207,8 @@ static int load_from_path(Unit *u, const char *path) { } - free(u->meta.load_path); - u->meta.load_path = filename; + free(u->meta.fragment_path); + u->meta.fragment_path = filename; filename = NULL; r = 1; /* returning 1 means: suitable config file found and loaded */ @@ -1229,8 +1229,8 @@ int unit_load_fragment(Unit *u) { assert(u); assert(u->meta.load_state == UNIT_STUB); - if (u->meta.load_path) - r = load_from_path(u, u->meta.load_path); + if (u->meta.fragment_path) + r = load_from_path(u, u->meta.fragment_path); else { Iterator i; char *t; diff --git a/manager.c b/manager.c index 68a662826..cb4475689 100644 --- a/manager.c +++ b/manager.c @@ -1184,7 +1184,7 @@ int manager_load_unit(Manager *m, const char *path, Unit **_ret) { return -ENOMEM; if (is_path(path)) { - if (!(ret->meta.load_path = strdup(path))) { + if (!(ret->meta.fragment_path = strdup(path))) { unit_free(ret); return -ENOMEM; } diff --git a/systemadm.vala b/systemadm.vala index edb3a389b..bc4f9403e 100644 --- a/systemadm.vala +++ b/systemadm.vala @@ -68,7 +68,7 @@ public class MainWindow : Window { private RightLabel unit_description_label; private RightLabel unit_load_state_label; private RightLabel unit_active_state_label; - private RightLabel unit_load_path_label; + private RightLabel unit_fragment_path_label; private RightLabel unit_active_enter_timestamp_label; private RightLabel unit_active_exit_timestamp_label; private RightLabel unit_can_start_label; @@ -133,7 +133,7 @@ public class MainWindow : Window { unit_description_label = new RightLabel(); unit_load_state_label = new RightLabel(); unit_active_state_label = new RightLabel(); - unit_load_path_label = new RightLabel(); + unit_fragment_path_label = new RightLabel(); unit_active_enter_timestamp_label = new RightLabel(); unit_active_exit_timestamp_label = new RightLabel(); unit_can_start_label = new RightLabel(); @@ -161,8 +161,8 @@ public class MainWindow : Window { unit_table.attach(unit_load_state_label, 1, 2, 2, 3, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0); unit_table.attach(new LeftLabel("Active State:"), 0, 1, 3, 4, AttachOptions.FILL, AttachOptions.FILL, 0, 0); unit_table.attach(unit_active_state_label, 1, 2, 3, 4, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0); - unit_table.attach(new LeftLabel("Load Path:"), 0, 1, 4, 5, AttachOptions.FILL, AttachOptions.FILL, 0, 0); - unit_table.attach(unit_load_path_label, 1, 2, 4, 5, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0); + unit_table.attach(new LeftLabel("Fragment Path:"), 0, 1, 4, 5, AttachOptions.FILL, AttachOptions.FILL, 0, 0); + unit_table.attach(unit_fragment_path_label, 1, 2, 4, 5, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0); unit_table.attach(new LeftLabel("Active Enter Timestamp:"), 0, 1, 5, 6, AttachOptions.FILL, AttachOptions.FILL, 0, 0); unit_table.attach(unit_active_enter_timestamp_label, 1, 2, 5, 6, AttachOptions.EXPAND|AttachOptions.FILL, AttachOptions.FILL, 0, 0); unit_table.attach(new LeftLabel("Active Exit Timestamp:"), 0, 1, 6, 7, AttachOptions.FILL, AttachOptions.FILL, 0, 0); @@ -311,7 +311,7 @@ public class MainWindow : Window { unit_description_label.set_text_or_na(); unit_load_state_label.set_text_or_na(); unit_active_state_label.set_text_or_na(); - unit_load_path_label.set_text_or_na(); + unit_fragment_path_label.set_text_or_na(); unit_active_enter_timestamp_label.set_text_or_na(); unit_active_exit_timestamp_label.set_text_or_na(); unit_can_reload_label.set_text_or_na(); @@ -323,7 +323,7 @@ public class MainWindow : Window { unit_description_label.set_text_or_na(unit.description); unit_load_state_label.set_text_or_na(unit.load_state); unit_active_state_label.set_text_or_na(unit.active_state); - unit_load_path_label.set_text_or_na(unit.load_path); + unit_fragment_path_label.set_text_or_na(unit.fragment_path); uint64 t = unit.active_enter_timestamp; if (t > 0) { diff --git a/systemd-interfaces.vala b/systemd-interfaces.vala index 6eba8a558..9947df54a 100644 --- a/systemd-interfaces.vala +++ b/systemd-interfaces.vala @@ -71,7 +71,7 @@ public interface Unit : DBus.Object { public abstract string description { owned get; } public abstract string load_state { owned get; } public abstract string active_state { owned get; } - public abstract string load_path { owned get; } + public abstract string fragment_path { owned get; } public abstract uint64 active_enter_timestamp { owned get; } public abstract uint64 active_exit_timestamp { owned get; } public abstract bool can_reload { owned get; } diff --git a/unit.c b/unit.c index b8a1d8bb3..980c3711e 100644 --- a/unit.c +++ b/unit.c @@ -284,7 +284,7 @@ void unit_free(Unit *u) { bidi_set_free(u, u->meta.dependencies[d]); free(u->meta.description); - free(u->meta.load_path); + free(u->meta.fragment_path); while ((t = set_steal_first(u->meta.names))) free(t); @@ -397,8 +397,8 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { prefix, yes_no(u->meta.recursive_stop), prefix, yes_no(u->meta.stop_when_unneeded)); - if (u->meta.load_path) - fprintf(f, "%s\tLoad Path: %s\n", prefix, u->meta.load_path); + if (u->meta.fragment_path) + fprintf(f, "%s\tFragment Path: %s\n", prefix, u->meta.fragment_path); SET_FOREACH(t, u->meta.names, i) fprintf(f, "%s\tName: %s\n", prefix, t); diff --git a/unit.h b/unit.h index 322e4aed9..9527d192d 100644 --- a/unit.h +++ b/unit.h @@ -124,7 +124,7 @@ struct Meta { Set *dependencies[_UNIT_DEPENDENCY_MAX]; char *description; - char *load_path; /* if loaded from a config file this is the primary path to it */ + char *fragment_path; /* if loaded from a config file this is the primary path to it */ /* If there is something to do with this unit, then this is * the job for it */ -- 2.30.2