chiark / gitweb /
tcpwrap: execute tcpwrap check in forked client, to avoid blocking name lookups in...
[elogind.git] / src / swap.c
index bd49e1ea2bd36e5743d9e30ad58605f52b389abc..6c0322f3e53c926271915c136dc68cf68ea20b8e 100644 (file)
@@ -37,7 +37,7 @@
 static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
         [SWAP_DEAD] = UNIT_INACTIVE,
         [SWAP_ACTIVE] = UNIT_ACTIVE,
-        [SWAP_MAINTAINANCE] = UNIT_INACTIVE
+        [SWAP_MAINTENANCE] = UNIT_INACTIVE
 };
 
 static void swap_init(Unit *u) {
@@ -115,7 +115,7 @@ static int swap_add_target_links(Swap *s) {
         if ((r = manager_load_unit(s->meta.manager, SPECIAL_SWAP_TARGET, NULL, &tu)) < 0)
                 return r;
 
-        if (!p->noauto && p->handle)
+        if (!p->noauto && p->handle && s->meta.manager->running_as != MANAGER_SESSION)
                 if ((r = unit_add_dependency(tu, UNIT_WANTS, UNIT(s), true)) < 0)
                         return r;
 
@@ -246,7 +246,7 @@ int swap_add_one(
                 bool from_proc_swaps) {
         Unit *u = NULL;
         char *e = NULL, *w = NULL;
-        bool delete;
+        bool delete = false;
         int r;
         SwapParameters *p;
 
@@ -382,7 +382,7 @@ static void swap_dump(Unit *u, FILE *f, const char *prefix) {
 static void swap_enter_dead(Swap *s, bool success) {
         assert(s);
 
-        swap_set_state(s, success ? SWAP_MAINTAINANCE : SWAP_DEAD);
+        swap_set_state(s, success ? SWAP_MAINTENANCE : SWAP_DEAD);
 }
 
 static int swap_start(Unit *u) {
@@ -391,7 +391,7 @@ static int swap_start(Unit *u) {
         int r;
 
         assert(s);
-        assert(s->state == SWAP_DEAD || s->state == SWAP_MAINTAINANCE);
+        assert(s->state == SWAP_DEAD || s->state == SWAP_MAINTENANCE);
 
         if (s->from_fragment)
                 priority = s->parameters_fragment.priority;
@@ -527,7 +527,7 @@ static void swap_shutdown(Manager *m) {
 static const char* const swap_state_table[_SWAP_STATE_MAX] = {
         [SWAP_DEAD] = "dead",
         [SWAP_ACTIVE] = "active",
-        [SWAP_MAINTAINANCE] = "maintainance"
+        [SWAP_MAINTENANCE] = "maintenance"
 };
 
 DEFINE_STRING_TABLE_LOOKUP(swap_state, SwapState);