diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-10-08 02:31:36 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-10-08 02:31:36 +0200 |
commit | 00dc5d769ac4a4019d6b6fe22e8383ec8b030a96 (patch) | |
tree | db347d86cae6f68f70c085b6560cb313248f2166 /src/load-fragment.c | |
parent | c2b3f093d98a9751ba413c9b5d5c572a8a15932c (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.c | 13 |
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: |