core: make sure to recheck current udev tag "systemd" before considering a device ready
Let's ensure that a device once tagged can become active/inactive simply by toggling the current tag. Note that this means that a device once tagged with "systemd" will always have a matching .device unit. However, the active/inactive state of the unit reflects whether it is currently tagged that way (and doesn't have SYSTEMD_READY=0 set). Fixes: #7587
This commit is contained in:
parent
31abedbb03
commit
242c1c075a
|
@ -736,6 +736,10 @@ static bool device_is_ready(sd_device *dev) {
|
|||
if (device_is_renaming(dev) > 0)
|
||||
return false;
|
||||
|
||||
/* Is it really tagged as 'systemd' right now? */
|
||||
if (sd_device_has_current_tag(dev, "systemd") <= 0)
|
||||
return false;
|
||||
|
||||
if (sd_device_get_property_value(dev, "SYSTEMD_READY", &ready) < 0)
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue