summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-25 21:08:39 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-25 22:10:22 +0100
commit9670d583d381d4c2c7f4d80de63bee7ad54fef44 (patch)
tree64468a91c77e6ea65f684353e3af59d6b20313ac /src/core/manager.c
parent0bee65f0622c4faa8ac8ae771cc0c8a936dfa284 (diff)
swap: always track the current real device node of all swap devices, even when not active
This way, we can avoid executing two /bin/swapon jobs to be dispatched for the same swap device if it is configured for two different paths. Previously we were just tracking the device nodes of active swap devices, which would not allow us to recognize the identity of two swap devices before they are active. https://bugs.freedesktop.org/show_bug.cgi?id=69835
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index ba4dab3b86..aa4baaacc8 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -490,6 +490,12 @@ int manager_new(SystemdRunningAs running_as, bool reexecuting, Manager **_m) {
if (r < 0)
goto fail;
+ m->udev = udev_new();
+ if (!m->udev) {
+ r = -ENOMEM;
+ goto fail;
+ }
+
if (running_as == SYSTEMD_SYSTEM)
try_bus_connect = reexecuting;
else if (getenv("DBUS_SESSION_BUS_ADDRESS"))
@@ -691,6 +697,7 @@ void manager_free(Manager *m) {
manager_close_idle_pipe(m);
+ udev_unref(m->udev);
sd_event_unref(m->event);
free(m->notify_socket);