X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Funit.c;h=c4ed9233731a88756e15b855b338bfdaa11a3a12;hp=153b79b3afc86d56969f33fe10f534d6014a7b13;hb=4e595329a93ed190795c2e24bf132d5028ec6a72;hpb=598459cebac7cc93089769a992e7b03287f77e12 diff --git a/src/core/unit.c b/src/core/unit.c index 153b79b3a..c4ed92337 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -121,6 +121,7 @@ static void unit_init(Unit *u) { cc->cpu_accounting = u->manager->default_cpu_accounting; cc->blockio_accounting = u->manager->default_blockio_accounting; cc->memory_accounting = u->manager->default_memory_accounting; + cc->cpu_quota_period_usec = u->manager->default_cpu_quota_period_usec; } ec = unit_get_exec_context(u); @@ -2487,10 +2488,18 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) { if (!s) return -ENOMEM; - free(u->cgroup_path); - u->cgroup_path = s; + if (u->cgroup_path) { + void *p; + + p = hashmap_remove(u->manager->cgroup_unit, u->cgroup_path); + log_info("Removing cgroup_path %s from hashmap (%p)", + u->cgroup_path, p); + free(u->cgroup_path); + } + u->cgroup_path = s; assert(hashmap_put(u->manager->cgroup_unit, s, u) == 1); + continue; }