diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-02-09 14:48:52 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-02-09 14:48:52 +0100 |
commit | 2958c8861471ba899ecbb5fcc1951d74746a9163 (patch) | |
tree | c8e7bb1c4e2801cf41013d5b4c07ce8d6b7a6fbc /src | |
parent | e1b2b49465615727a2c3883d06d1b9ff339aec67 (diff) |
device: consider udev devices with SYSTEMD_READY=0 as unplugged
Diffstat (limited to 'src')
-rw-r--r-- | src/device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/device.c b/src/device.c index 5289da3e42..b9d8a2b9cf 100644 --- a/src/device.c +++ b/src/device.c @@ -526,7 +526,7 @@ fail: void device_fd_event(Manager *m, int events) { struct udev_device *dev; int r; - const char *action; + const char *action, *ready; assert(m); @@ -552,7 +552,9 @@ void device_fd_event(Manager *m, int events) { goto fail; } - if (streq(action, "remove")) { + ready = udev_device_get_property_value(dev, "SYSTEMD_READY"); + + if (streq(action, "remove") || (ready && parse_boolean(ready) == 0)) { if ((r = device_process_removed_device(m, dev)) < 0) { log_error("Failed to process udev device event: %s", strerror(-r)); goto fail; |