summaryrefslogtreecommitdiff
path: root/src/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-08 02:31:36 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-08 02:31:36 +0200
commit00dc5d769ac4a4019d6b6fe22e8383ec8b030a96 (patch)
treedb347d86cae6f68f70c085b6560cb313248f2166 /src/load-fragment.c
parentc2b3f093d98a9751ba413c9b5d5c572a8a15932c (diff)
unit: introduce 'banned' load state for units symlinked to /dev/null
Diffstat (limited to 'src/load-fragment.c')
-rw-r--r--src/load-fragment.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 1685c4adb7..54b1af041c 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1883,9 +1883,15 @@ static int load_from_path(Unit *u, const char *path) {
goto finish;
}
- /* Now, parse the file contents */
- if ((r = config_parse(filename, f, sections, items, false, u)) < 0)
- goto finish;
+ if (null_or_empty(&st))
+ u->meta.load_state = UNIT_BANNED;
+ else {
+ /* Now, parse the file contents */
+ if ((r = config_parse(filename, f, sections, items, false, u)) < 0)
+ goto finish;
+
+ u->meta.load_state = UNIT_LOADED;
+ }
free(u->meta.fragment_path);
u->meta.fragment_path = filename;
@@ -1893,7 +1899,6 @@ static int load_from_path(Unit *u, const char *path) {
u->meta.fragment_mtime = timespec_load(&st.st_mtim);
- u->meta.load_state = UNIT_LOADED;
r = 0;
finish: