summaryrefslogtreecommitdiffstats
path: root/src/libsystemd/sd-device/sd-device.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-07-11 12:02:04 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-07-11 14:08:52 +0200
commit591c186f2fc11523e098fbb09b3c1f0a07d49ca4 (patch)
tree40d4091442fd9a0b6ce7e1eab21692bba93638bd /src/libsystemd/sd-device/sd-device.c
parentMerge pull request #23962 from keszybz/taint-flag-support-ended (diff)
downloadsystemd-591c186f2fc11523e098fbb09b3c1f0a07d49ca4.tar.xz
systemd-591c186f2fc11523e098fbb09b3c1f0a07d49ca4.zip
sd-device: make sd_device_get_is_initialized() not return -ENOENT
Diffstat (limited to '')
-rw-r--r--src/libsystemd/sd-device/sd-device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index aaf951ced8..62531b9564 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -1589,6 +1589,9 @@ _public_ int sd_device_get_is_initialized(sd_device *device) {
assert_return(device, -EINVAL);
r = device_read_db(device);
+ if (r == -ENOENT)
+ /* The device may be already removed or renamed. */
+ return false;
if (r < 0)
return r;