chiark / gitweb /
cgroup.c: check return value of unit_realize_cgroup_now()
authorHarald Hoyer <harald@redhat.com>
Fri, 23 Aug 2013 16:46:06 +0000 (18:46 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 23 Aug 2013 16:46:51 +0000 (18:46 +0200)
do not recurse further, if unit_realize_cgroup_now() failed

src/core/cgroup.c

index 5a1c3adacd19af3f8ff2c67ebcb98ea7ab2e53cd..50b17f3802d6e453584cca0065ab86a297c39d51 100644 (file)
@@ -432,8 +432,13 @@ static int unit_realize_cgroup_now(Unit *u) {
                 return 0;
 
         /* First, realize parents */
-        if (UNIT_ISSET(u->slice))
-                unit_realize_cgroup_now(UNIT_DEREF(u->slice));
+        if (UNIT_ISSET(u->slice)) {
+                int r;
+
+                r = unit_realize_cgroup_now(UNIT_DEREF(u->slice));
+                if (r < 0)
+                        return r;
+        }
 
         /* And then do the real work */
         return unit_create_cgroups(u, mask);