]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/dbus-swap.c
update TODO
[thirdparty/systemd.git] / src / core / dbus-swap.c
index 353fa201321a900d57f6f9afbc9fb463dfeae2b4..cb4824b6bd943aa77f77a8655d23f3f2a3008e8d 100644 (file)
@@ -3,7 +3,7 @@
   Copyright © 2010 Maarten Lankhorst
 ***/
 
-#include "bus-util.h"
+#include "bus-get-properties.h"
 #include "dbus-cgroup.h"
 #include "dbus-execute.h"
 #include "dbus-swap.h"
 #include "unit.h"
 
 static int swap_get_priority(Swap *s) {
-        if (s->from_proc_swaps)
+        assert(s);
+
+        if (s->from_proc_swaps && s->parameters_proc_swaps.priority_set)
                 return s->parameters_proc_swaps.priority;
-        if (s->from_fragment)
+
+        if (s->from_fragment && s->parameters_fragment.priority_set)
                 return s->parameters_fragment.priority;
+
         return -1;
 }
 
 static const char *swap_get_options(Swap *s) {
+        assert(s);
+
         if (s->from_fragment)
                 return s->parameters_fragment.options;
+
         return NULL;
 }