chiark / gitweb /
core: fix return value on OOM
[elogind.git] / src / core / slice.c
index 057feefa0fd67889d75f74e3bec3e47da642fe99..4d2eaf7ed64b8729cb1da52a475db8c40be38f99 100644 (file)
 ***/
 
 #include <errno.h>
-#include <signal.h>
-#include <unistd.h>
 
 #include "unit.h"
 #include "slice.h"
-#include "load-fragment.h"
 #include "log.h"
 #include "dbus-slice.h"
 #include "special.h"
@@ -113,7 +110,7 @@ static int slice_verify(Slice *s) {
                         a = (char*) SPECIAL_ROOT_SLICE;
 
                 if (!unit_has_name(UNIT_DEREF(UNIT(s)->slice), a)) {
-                        log_error_unit(UNIT(s)->id,
+                        log_unit_error(UNIT(s)->id,
                                        "%s located outside its parent slice. Refusing.", UNIT(s)->id);
                         return -EINVAL;
                 }
@@ -187,7 +184,7 @@ static int slice_start(Unit *u) {
         unit_realize_cgroup(u);
 
         slice_set_state(t, SLICE_ACTIVE);
-        return 0;
+        return 1;
 }
 
 static int slice_stop(Unit *u) {
@@ -200,7 +197,7 @@ static int slice_stop(Unit *u) {
          * unit_notify() will do that for us anyway. */
 
         slice_set_state(t, SLICE_DEAD);
-        return 0;
+        return 1;
 }
 
 static int slice_kill(Unit *u, KillWho who, int signo, sd_bus_error *error) {