X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmanager.c;h=74bd740747800217ec2911d6be0c8e903753514b;hb=3e2147858f21943d5f4a781c60f33ac22c6096ed;hp=bab16627064abbe4572c44b03bfae8d3801e1be4;hpb=595ed347a87e69893c5e72168fc2e94a7cb09e73;p=elogind.git diff --git a/src/manager.c b/src/manager.c index bab166270..74bd74074 100644 --- a/src/manager.c +++ b/src/manager.c @@ -247,8 +247,11 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) { if (!(m->environment = strv_copy(environ))) goto fail; - if (!(m->default_controllers = strv_new("cpu", NULL))) - goto fail; + if (running_as == MANAGER_SYSTEM) { + m->default_controllers = strv_new("cpu", NULL); + if (!m->default_controllers) + goto fail; + } if (!(m->units = hashmap_new(string_hash_func, string_compare_func))) goto fail; @@ -2940,7 +2943,7 @@ bool manager_is_booting_or_shutting_down(Manager *m) { assert(m); /* Is the initial job still around? */ - if (manager_get_job(m, 1)) + if (manager_get_job(m, m->default_unit_job_id)) return true; /* Is there a job for the shutdown target? */