systemd: Properly handle device aliases used as dependencies

http://lists.freedesktop.org/archives/systemd-devel/2012-October/006872.html
This commit is contained in:
Eelco Dolstra 2012-10-11 12:33:28 -04:00
parent fa27534ec6
commit 2fa1b38853
2 changed files with 15 additions and 1 deletions

View File

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
sha256 = "0cgnnl6kqaz3als5y9g8jvsvbs4c8ccp0vl4s1g8rwk69w2cwxd2"; sha256 = "0cgnnl6kqaz3als5y9g8jvsvbs4c8ccp0vl4s1g8rwk69w2cwxd2";
}; };
patches = [ ./reexec.patch ./ignore-duplicates.patch ]; patches = [ ./reexec.patch ./ignore-duplicates.patch ./fix-device-aliases.patch ];
buildInputs = buildInputs =
[ pkgconfig intltool gperf libcap dbus kmod xz pam acl [ pkgconfig intltool gperf libcap dbus kmod xz pam acl

View File

@ -0,0 +1,14 @@
diff --git a/src/core/device.c b/src/core/device.c
index 5307341..7bbe99a 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -255,8 +255,7 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
if (!is_path(alias))
log_warning("SYSTEMD_ALIAS for %s is not a path, ignoring: %s", sysfs, alias);
else {
- if ((r = device_add_escaped_name(u, alias)) < 0)
- goto fail;
+ device_update_unit(m, dev, alias, false);
}
}