diff options
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 3ccb392f66..30437425c4 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -476,6 +476,7 @@ static void manager_clear_jobs_and_units(Manager *m) { void manager_free(Manager *m) { UnitType c; + int i; assert(m); @@ -525,6 +526,9 @@ void manager_free(Manager *m) { free(m->switch_root); free(m->switch_root_init); + for (i = 0; i < RLIMIT_NLIMITS; i++) + free(m->rlimit[i]); + free(m); } @@ -2136,6 +2140,24 @@ int manager_set_default_controllers(Manager *m, char **controllers) { return 0; } +int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit) { + int i; + + assert(m); + + for (i = 0; i < RLIMIT_NLIMITS; i++) { + if (default_rlimit[i]) { + m->rlimit[i] = newdup(struct rlimit, default_rlimit[i], 1); + + if (!m->rlimit[i]) + return -ENOMEM; + } + } + + return 0; +} + + void manager_recheck_journal(Manager *m) { Unit *u; |