]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-device: use ERRNO_IS_NEG_DEVICE_ABSENT() for device-id load failures (#41764)
author我超厉害 <524413304@qq.com>
Thu, 14 May 2026 17:51:29 +0000 (01:51 +0800)
committerGitHub <noreply@github.com>
Thu, 14 May 2026 17:51:29 +0000 (02:51 +0900)
commita03f3af3e3816da18b677cf2de585ec0cac452ab
treed0fddefd0a77413763d3c29f83869fb5c13cdd69
parentf795ecc3d728a21c5800a73e8c7407b45e0cc85a
sd-device: use ERRNO_IS_NEG_DEVICE_ABSENT() for device-id load failures (#41764)

Device enumeration may encounter transient errors such as ENXIO when devices
appear or disappear concurrently. These conditions represent expected "device absent"
races and should be treated uniformly across the enumeration logic.

This change replaces the ENODEV-specific check with ERRNO_IS_NEG_DEVICE_ABSENT(),
ensuring that all expected disappearance conditions are handled consistently.
Unexpected errors are still propagated, while expected races are ignored without
aborting the enumeration.
src/libsystemd/sd-device/device-enumerator.c