From: Yu Watanabe Date: Tue, 5 Nov 2019 14:02:31 +0000 (+0900) Subject: sd-device-enumerator: do not return error when a device is removed X-Git-Tag: v244-rc1~94 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=3126d64e5f04cd39033f8c5055e80440b8680d86;p=systemd%2F.git sd-device-enumerator: do not return error when a device is removed Fixes #13814. --- diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c index 5b54641213..a1932f41f9 100644 --- a/src/libsystemd/sd-device/device-enumerator.c +++ b/src/libsystemd/sd-device/device-enumerator.c @@ -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; }