diff options
Diffstat (limited to 'src/libsystemd/sd-device/sd-device.c')
-rw-r--r-- | src/libsystemd/sd-device/sd-device.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index af39c984d0..97e2e727c0 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -758,14 +758,12 @@ int device_read_uevent_file(sd_device *device) { path = strjoina(syspath, "/uevent"); r = read_full_virtual_file(path, &uevent, &uevent_len); - if (r < 0) { + if (r == -EACCES || ERRNO_IS_NEG_DEVICE_ABSENT(r)) /* The uevent files may be write-only, the device may be already removed, or the device * may not have the uevent file. */ - if (r == -EACCES || ERRNO_IS_DEVICE_ABSENT(r)) - return 0; - + return 0; + if (r < 0) return log_device_debug_errno(device, r, "sd-device: Failed to read uevent file '%s': %m", path); - } for (size_t i = 0; i < uevent_len; i++) switch (state) { |