chiark / gitweb /
socket: properly serialize/desrialize mqueue fds
[elogind.git] / src / core / swap.c
index 206bd939caec24fa3d845a163f8084b2fc4e3955..bd40516c99743743238ea87a9025b067e07dadaf 100644 (file)
@@ -427,7 +427,8 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
                         return log_oom();
 
                 dn = udev_device_get_devnode(d);
-                if (dn)
+                /* Skip dn==device, since that case will be handled below */
+                if (dn && !streq(dn, device))
                         r = swap_add_one(m, dn, device, prio, false, false, set_flags);
 
                 /* Add additional units for all symlinks */
@@ -520,7 +521,7 @@ static int swap_coldplug(Unit *u) {
                         if (r < 0)
                                 return r;
 
-                        r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch);
+                        r = unit_watch_timer(UNIT(s), CLOCK_MONOTONIC, true, s->timeout_usec, &s->timer_watch);
                         if (r < 0)
                                 return r;
                 }
@@ -583,7 +584,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
         assert(c);
         assert(_pid);
 
-        r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch);
+        r = unit_watch_timer(UNIT(s), CLOCK_MONOTONIC, true, s->timeout_usec, &s->timer_watch);
         if (r < 0)
                 goto fail;
 
@@ -688,7 +689,7 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) {
         }
 
         if (wait_for_exit) {
-                r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch);
+                r = unit_watch_timer(UNIT(s), CLOCK_MONOTONIC, true, s->timeout_usec, &s->timer_watch);
                 if (r < 0)
                         goto fail;