chiark / gitweb /
device: allow easy identification of network interfaces without their full sysfs...
[elogind.git] / swap.c
diff --git a/swap.c b/swap.c
index aacf0e8d554ba107f2e577202f9fc4dfcb8178dc..fffd0b9239e28a1a54c2b12e6bd5d8154271918d 100644 (file)
--- a/swap.c
+++ b/swap.c
@@ -40,6 +40,14 @@ static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
         [SWAP_MAINTAINANCE] = UNIT_INACTIVE
 };
 
+static void swap_done(Unit *u) {
+        Swap *s = SWAP(u);
+
+        assert(s);
+
+        free(s->what);
+}
+
 static int swap_verify(Swap *s) {
         bool b;
         char *e;
@@ -310,7 +318,8 @@ static int swap_load_proc_swaps(Manager *m) {
         Meta *meta;
 
         rewind(m->proc_swaps);
-        fscanf(m->proc_self_mountinfo, "%*s %*s %*s %*s %*s\n");
+
+        (void) fscanf(m->proc_self_mountinfo, "%*s %*s %*s %*s %*s\n");
 
         for (;;) {
                 char *dev = NULL, *d;
@@ -398,8 +407,10 @@ const UnitVTable swap_vtable = {
 
         .no_alias = true,
         .no_instances = true,
+        .no_isolate = true,
 
         .load = swap_load,
+        .done = swap_done,
 
         .coldplug = swap_coldplug,
 
@@ -418,7 +429,6 @@ const UnitVTable swap_vtable = {
 
         .bus_message_handler = bus_swap_message_handler,
 
-        .shutdown = swap_shutdown,
-
-        .enumerate = swap_enumerate
+        .enumerate = swap_enumerate,
+        .shutdown = swap_shutdown
 };