chiark / gitweb /
Merge branch 'master' of ssh://git.freedesktop.org/git/systemd
[elogind.git] / src / unit.c
index 18faae22e47c48b98bcbb9918e26014f354c1400..b362fd3b41957385e7e106f2a10bc98e45bc7bce 100644 (file)
@@ -39,6 +39,7 @@
 #include "specifier.h"
 #include "dbus-unit.h"
 #include "special.h"
+#include "cgroup-util.h"
 
 const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
         [UNIT_SERVICE] = &service_vtable,
@@ -1144,14 +1145,14 @@ int unit_watch_pid(Unit *u, pid_t pid) {
         /* Watch a specific PID. We only support one unit watching
          * each PID for now. */
 
-        return hashmap_put(u->meta.manager->watch_pids, UINT32_TO_PTR(pid), u);
+        return hashmap_put(u->meta.manager->watch_pids, LONG_TO_PTR(pid), u);
 }
 
 void unit_unwatch_pid(Unit *u, pid_t pid) {
         assert(u);
         assert(pid >= 1);
 
-        hashmap_remove_value(u->meta.manager->watch_pids, UINT32_TO_PTR(pid), u);
+        hashmap_remove_value(u->meta.manager->watch_pids, LONG_TO_PTR(pid), u);
 }
 
 int unit_watch_timer(Unit *u, usec_t delay, Watch *w) {
@@ -1598,7 +1599,7 @@ int unit_add_cgroup_from_text(Unit *u, const char *name) {
         if (n > 0)
                 controller = strndup(name, n);
         else
-                controller = strdup(u->meta.manager->cgroup_controller);
+                controller = strdup(SYSTEMD_CGROUP_CONTROLLER);
 
         if (!controller) {
                 r = -ENOMEM;
@@ -1647,7 +1648,7 @@ int unit_add_default_cgroup(Unit *u) {
         if (!(b = new0(CGroupBonding, 1)))
                 return -ENOMEM;
 
-        if (!(b->controller = strdup(u->meta.manager->cgroup_controller)))
+        if (!(b->controller = strdup(SYSTEMD_CGROUP_CONTROLLER)))
                 goto fail;
 
         if (!(b->path = default_cgroup_path(u)))
@@ -1672,7 +1673,7 @@ fail:
 CGroupBonding* unit_get_default_cgroup(Unit *u) {
         assert(u);
 
-        return cgroup_bonding_find_list(u->meta.cgroup_bondings, u->meta.manager->cgroup_controller);
+        return cgroup_bonding_find_list(u->meta.cgroup_bondings, SYSTEMD_CGROUP_CONTROLLER);
 }
 
 int unit_load_related_unit(Unit *u, const char *type, Unit **_found) {