X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=manager.c;h=6913ff400db9dee435779b76fc5e5e6892781f28;hb=5ffceb2feae45b19a39d545468552ff2b7fb8e6d;hp=1691719a66b72bd48eea4dfa58331409c0070e09;hpb=1005d14f4a6d5bd8f035169cb5df4c890284f211;p=elogind.git diff --git a/manager.c b/manager.c index 1691719a6..6913ff400 100644 --- a/manager.c +++ b/manager.c @@ -51,6 +51,7 @@ #include "unit-name.h" #include "dbus-unit.h" #include "dbus-job.h" +#include "missing.h" /* As soon as 16 units are in our GC queue, make sure to run a gc sweep */ #define GC_QUEUE_ENTRIES_MAX 16 @@ -253,7 +254,7 @@ static int manager_find_paths(Manager *m) { } if (m->running_as == MANAGER_INIT) { - /* /etc/init.d/ compativility does not matter to users */ + /* /etc/init.d/ compatibility does not matter to users */ if ((e = getenv("SYSTEMD_SYSVINIT_PATH"))) if (!(m->sysvinit_path = split_path_and_make_absolute(e))) @@ -336,6 +337,9 @@ int manager_new(ManagerRunningAs running_as, bool confirm_spawn, Manager **_m) { m->signal_watch.fd = m->mount_watch.fd = m->udev_watch.fd = m->epoll_fd = m->dev_autofs_fd = -1; m->current_job_id = 1; /* start as id #1, so that we can leave #0 around as "null-like" value */ + if (!(m->environment = strv_copy(environ))) + goto fail; + if (!(m->units = hashmap_new(string_hash_func, string_compare_func))) goto fail; @@ -544,6 +548,7 @@ void manager_free(Manager *m) { strv_free(m->unit_path); strv_free(m->sysvinit_path); strv_free(m->sysvrcnd_path); + strv_free(m->environment); free(m->cgroup_controller); free(m->cgroup_hierarchy);