summaryrefslogtreecommitdiff
path: root/src/core
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/core
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/core')
-rw-r--r--src/core/manager.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index b1f79e014e..6ce3e404c9 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -100,7 +100,6 @@ static int manager_dispatch_idle_pipe_fd(sd_event_source *source, int fd, uint32
static int manager_dispatch_jobs_in_progress(sd_event_source *source, usec_t usec, void *userdata);
static int manager_dispatch_run_queue(sd_event_source *source, void *userdata);
static int manager_run_generators(Manager *m);
-static void manager_undo_generators(Manager *m);
static void manager_watch_jobs_in_progress(Manager *m) {
usec_t next;
@@ -930,7 +929,7 @@ Manager* manager_free(Manager *m) {
* around */
manager_shutdown_cgroup(m, m->exit_code != MANAGER_REEXECUTE);
- manager_undo_generators(m);
+ lookup_paths_flush_generator(&m->lookup_paths);
bus_done(m);
@@ -2522,7 +2521,7 @@ int manager_reload(Manager *m) {
/* From here on there is no way back. */
manager_clear_jobs_and_units(m);
- manager_undo_generators(m);
+ lookup_paths_flush_generator(&m->lookup_paths);
lookup_paths_free(&m->lookup_paths);
q = lookup_paths_init(&m->lookup_paths, m->unit_file_scope, NULL);
@@ -2750,17 +2749,6 @@ finish:
return r;
}
-static void manager_undo_generators(Manager *m) {
- assert(m);
-
- if (m->lookup_paths.generator)
- (void) rm_rf(m->lookup_paths.generator, REMOVE_ROOT);
- if (m->lookup_paths.generator_early)
- (void) rm_rf(m->lookup_paths.generator_early, REMOVE_ROOT);
- if (m->lookup_paths.generator_late)
- (void) rm_rf(m->lookup_paths.generator_late, REMOVE_ROOT);
-}
-
int manager_environment_add(Manager *m, char **minus, char **plus) {
char **a = NULL, **b = NULL, **l;
assert(m);