mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
fix reload propagation for device alias
udev-made .device aliases are not normal alias They are full-fledged units which are linked to the same sysfs path we need to explicitely propagate reload to all alias
This commit is contained in:
parent
4f5e172341
commit
bf70ff2cff
@ -798,12 +798,11 @@ static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
|
|||||||
if (streq(action, "change")) {
|
if (streq(action, "change")) {
|
||||||
_cleanup_free_ char *e = NULL;
|
_cleanup_free_ char *e = NULL;
|
||||||
Unit *u;
|
Unit *u;
|
||||||
|
Device *d, *l, *n;
|
||||||
|
|
||||||
r = unit_name_from_path(sysfs, ".device", &e);
|
l = hashmap_get(m->devices_by_sysfs, sysfs);
|
||||||
if (r < 0)
|
LIST_FOREACH_SAFE(same_sysfs, d, n, l) {
|
||||||
log_error_errno(r, "Failed to generate unit name from device path: %m");
|
u = &d->meta;
|
||||||
else {
|
|
||||||
u = manager_get_unit(m, e);
|
|
||||||
if (u && UNIT_VTABLE(u)->active_state(u) == UNIT_ACTIVE) {
|
if (u && UNIT_VTABLE(u)->active_state(u) == UNIT_ACTIVE) {
|
||||||
r = manager_propagate_reload(m, u, JOB_REPLACE, NULL);
|
r = manager_propagate_reload(m, u, JOB_REPLACE, NULL);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user