chiark / gitweb /
core: don't do runaway fork()s if we hit a segfault from our segfault handler
[elogind.git] / src / core / swap.c
index b363c5ec092b2814dfbfbbc91f4445eb967499c2..d6721a6b31002524da35ae40963a824477e874ef 100644 (file)
@@ -214,7 +214,7 @@ static int swap_add_default_dependencies(Swap *s) {
 
 static int swap_verify(Swap *s) {
         bool b;
-        char _cleanup_free_ *e = NULL;
+        _cleanup_free_ char *e = NULL;
 
         if (UNIT(s)->load_state != UNIT_LOADED)
                   return 0;
@@ -287,6 +287,10 @@ static int swap_load(Unit *u) {
                 if (r < 0)
                         return r;
 
+                r = unit_add_default_slice(u);
+                if (r < 0)
+                        return r;
+
                 r = unit_add_default_cgroups(u);
                 if (r < 0)
                         return r;
@@ -315,7 +319,7 @@ static int swap_add_one(
                 bool set_flags) {
 
         Unit *u = NULL;
-        char _cleanup_free_ *e = NULL;
+        _cleanup_free_ char *e = NULL;
         char *wp = NULL;
         bool delete = false;
         int r;
@@ -899,19 +903,19 @@ static int swap_deserialize_item(Unit *u, const char *key, const char *value, FD
         return 0;
 }
 
-static UnitActiveState swap_active_state(Unit *u) {
+_pure_ static UnitActiveState swap_active_state(Unit *u) {
         assert(u);
 
         return state_translation_table[SWAP(u)->state];
 }
 
-static const char *swap_sub_state_to_string(Unit *u) {
+_pure_ static const char *swap_sub_state_to_string(Unit *u) {
         assert(u);
 
         return swap_state_to_string(SWAP(u)->state);
 }
 
-static bool swap_check_gc(Unit *u) {
+_pure_ static bool swap_check_gc(Unit *u) {
         Swap *s = SWAP(u);
 
         assert(s);