1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

unit: don't add automatic dependencies on device units if they aren't supported

http://lists.freedesktop.org/archives/systemd-devel/2015-April/031187.html
This commit is contained in:
Lennart Poettering 2015-04-24 17:28:06 +02:00
parent 658f26b828
commit 47bc12e1ba

View File

@ -2846,14 +2846,18 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) {
assert(u);
if (!what)
/* Adds in links to the device node that this unit is based on */
if (isempty(what))
return 0;
/* Adds in links to the device node that this unit is based on */
if (!is_device_path(what))
return 0;
/* When device units aren't supported (such as in a
* container), don't create dependencies on them. */
if (unit_vtable[UNIT_DEVICE]->supported && !unit_vtable[UNIT_DEVICE]->supported(u->manager))
return 0;
e = unit_name_from_path(what, ".device");
if (!e)
return -ENOMEM;