summaryrefslogtreecommitdiff
path: root/src/load-fragment.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/load-fragment.c')
-rw-r--r--src/load-fragment.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 6a71d422f4..394aa023f3 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1690,7 +1690,13 @@ static int load_from_path(Unit *u, const char *path) {
goto finish;
}
- if ((r = open_follow(&filename, &f, symlink_names, &id)) < 0) {
+ if (u->meta.manager->unit_path_cache &&
+ !set_get(u->meta.manager->unit_path_cache, filename))
+ r = -ENOENT;
+ else
+ r = open_follow(&filename, &f, symlink_names, &id);
+
+ if (r < 0) {
char *sn;
free(filename);