From: Lennart Poettering Date: Tue, 9 Oct 2018 17:34:23 +0000 (+0200) Subject: core: turn our four vacuum calls into a new helper function X-Git-Tag: v240~585^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5197be06e03a60dd1ebab7cdb9d2ef8f585a46c6;p=thirdparty%2Fsystemd.git core: turn our four vacuum calls into a new helper function Just share some code. No functional changes. --- diff --git a/src/core/manager.c b/src/core/manager.c index 0282ae32538..d12d07707aa 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1581,6 +1581,20 @@ static void manager_preset_all(Manager *m) { log_info("Populated /etc with preset unit settings."); } +static void manager_vacuum(Manager *m) { + assert(m); + + /* Release any dynamic users no longer referenced */ + dynamic_user_vacuum(m, true); + + /* Release any references to UIDs/GIDs no longer referenced, and destroy any IPC owned by them */ + manager_vacuum_uid_refs(m); + manager_vacuum_gid_refs(m); + + /* Release any runtimes no longer referenced */ + exec_runtime_vacuum(m); +} + int manager_startup(Manager *m, FILE *serialization, FDSet *fds) { int r; @@ -1662,14 +1676,8 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds) { /* Third, fire things up! */ manager_coldplug(m); - /* Release any dynamic users no longer referenced */ - dynamic_user_vacuum(m, true); - - /* Release any references to UIDs/GIDs no longer referenced, and destroy any IPC owned by them */ - manager_vacuum_uid_refs(m); - manager_vacuum_gid_refs(m); - - exec_runtime_vacuum(m); + /* Clean up runtime objects */ + manager_vacuum(m); if (serialization) { assert(m->n_reloading > 0); @@ -3540,14 +3548,8 @@ int manager_reload(Manager *m) { /* Third, fire things up! */ manager_coldplug(m); - /* Release any dynamic users no longer referenced */ - dynamic_user_vacuum(m, true); - - /* Release any references to UIDs/GIDs no longer referenced, and destroy any IPC owned by them */ - manager_vacuum_uid_refs(m); - manager_vacuum_gid_refs(m); - - exec_runtime_vacuum(m); + /* Clean up runtime objects no longer referenced */ + manager_vacuum(m); /* Consider the reload process complete now. */ assert(m->n_reloading > 0);