summaryrefslogtreecommitdiff
path: root/src/shared/path-lookup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-06 20:47:44 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:31 +0200
commit07a7864324e146662cb06f49fc3cd666788e2e2f (patch)
treeb568cd995b905b332616ee7f496403a774f6633d /src/shared/path-lookup.c
parentd8d410f4455238e30daa1775b469e31f34371f87 (diff)
core: move flushing of generated unit files to path-lookup.c
It's very similar to the mkdir and trim operations for the generator dirs, hence let's unify this at a single place.
Diffstat (limited to 'src/shared/path-lookup.c')
-rw-r--r--src/shared/path-lookup.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 0735e3b4f5..685ae895d2 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -726,3 +726,14 @@ void lookup_paths_trim_generator(LookupPaths *p) {
if (p->generator_late)
(void) rmdir(p->generator_late);
}
+
+void lookup_paths_flush_generator(LookupPaths *p) {
+ assert(p);
+
+ if (p->generator)
+ (void) rm_rf(p->generator, REMOVE_ROOT);
+ if (p->generator_early)
+ (void) rm_rf(p->generator_early, REMOVE_ROOT);
+ if (p->generator_late)
+ (void) rm_rf(p->generator_late, REMOVE_ROOT);
+}