From 30b55e98d1d01d790946d4f8bb197f3f0a9e8e60 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 24 Jul 2024 21:24:13 +0200 Subject: [PATCH] core/manager: do not re-init Manager.lookup_paths when manager_reload() Follow-up for 99aad9a2b9e2c06023a2043976fd9395332ff097 The commit changed lookup_paths_init_or_warn() call to be fatal to manager_reload(), but invoke_main_loop() assumes that manager_reload() would only return recoverable error, and put the manager back to MANAGER_OK in that case, which is spurious. Looking at it more, it appears to be utterly unnecessary to reinitialize LookupPaths here, given that nothing during the reload process would change the search dirs. Let's drop the path altogether hence. --- src/core/manager.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/core/manager.c b/src/core/manager.c index 81db683553f..2dddc797222 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -3707,21 +3707,14 @@ int manager_reload(Manager *m) { manager_clear_jobs_and_units(m); lookup_paths_flush_generator(&m->lookup_paths); - lookup_paths_done(&m->lookup_paths); exec_shared_runtime_vacuum(m); dynamic_user_vacuum(m, false); m->uid_refs = hashmap_free(m->uid_refs); m->gid_refs = hashmap_free(m->gid_refs); - r = lookup_paths_init_or_warn(&m->lookup_paths, m->runtime_scope, 0, NULL); - if (r < 0) - return r; - (void) manager_run_environment_generators(m); (void) manager_run_generators(m); - lookup_paths_log(&m->lookup_paths); - /* We flushed out generated files, for which we don't watch mtime, so we should flush the old map. */ manager_free_unit_name_maps(m); m->unit_file_state_outdated = false; -- 2.47.3