From bf70ff2cff719905f9dc3f726eaba79780dcae55 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9my=20Rosen?= Date: Sat, 6 Jan 2018 22:55:22 +0100 Subject: [PATCH] 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 --- src/core/device.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/device.c b/src/core/device.c index dec6e74..7ce971f 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -798,12 +798,11 @@ static int device_dispatch_io(sd_event_source *source, int fd, uint32_t revents, if (streq(action, "change")) { _cleanup_free_ char *e = NULL; Unit *u; + Device *d, *l, *n; - r = unit_name_from_path(sysfs, ".device", &e); - if (r < 0) - log_error_errno(r, "Failed to generate unit name from device path: %m"); - else { - u = manager_get_unit(m, e); + l = hashmap_get(m->devices_by_sysfs, sysfs); + LIST_FOREACH_SAFE(same_sysfs, d, n, l) { + u = &d->meta; if (u && UNIT_VTABLE(u)->active_state(u) == UNIT_ACTIVE) { r = manager_propagate_reload(m, u, JOB_REPLACE, NULL); if (r < 0) -- 2.7.4