sd-device-enumerator: do not return error when a device is removed

Fixes #13814.
This commit is contained in:
Yu Watanabe 2019-11-05 23:02:31 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent c631c3d6a3
commit 3126d64e5f
1 changed files with 7 additions and 2 deletions

View File

@ -506,7 +506,10 @@ static int enumerator_scan_dir_and_add_devices(sd_device_enumerator *enumerator,
initialized = sd_device_get_is_initialized(device);
if (initialized < 0) {
r = initialized;
if (initialized != -ENOENT)
/* this is necessarily racey, so ignore missing devices */
r = initialized;
continue;
}
@ -639,7 +642,9 @@ static int enumerator_scan_devices_tag(sd_device_enumerator *enumerator, const c
k = sd_device_get_subsystem(device, &subsystem);
if (k < 0) {
r = k;
if (k != -ENOENT)
/* this is necessarily racy, so ignore missing devices */
r = k;
continue;
}