config: don't fail if a device vanished by the time we managed to look at it
The nature of hotplug is that a device we enumerated might already be gone by the time we look at it, so don't assume otherwise. Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
f13de9ca1b
commit
6cea28fe4b
@ -301,6 +301,11 @@ config_udev_init(void)
|
|||||||
udev_list_entry_foreach(device, devices) {
|
udev_list_entry_foreach(device, devices) {
|
||||||
const char *syspath = udev_list_entry_get_name(device);
|
const char *syspath = udev_list_entry_get_name(device);
|
||||||
struct udev_device *udev_device = udev_device_new_from_syspath(udev, syspath);
|
struct udev_device *udev_device = udev_device_new_from_syspath(udev, syspath);
|
||||||
|
|
||||||
|
/* Device might be gone by the time we try to open it */
|
||||||
|
if (!udev_device)
|
||||||
|
continue;
|
||||||
|
|
||||||
device_added(udev_device);
|
device_added(udev_device);
|
||||||
udev_device_unref(udev_device);
|
udev_device_unref(udev_device);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user