summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/path-lookup.c11
-rw-r--r--src/shared/path-lookup.h1
2 files changed, 12 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);
+}
diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h
index 03f103dcc0..d151347a1b 100644
--- a/src/shared/path-lookup.h
+++ b/src/shared/path-lookup.h
@@ -53,6 +53,7 @@ int lookup_paths_reduce(LookupPaths *p);
int lookup_paths_mkdir_generator(LookupPaths *p);
void lookup_paths_trim_generator(LookupPaths *p);
+void lookup_paths_flush_generator(LookupPaths *p);
void lookup_paths_free(LookupPaths *p);
#define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free)