]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: make sd_device_get_is_initialized() not return -ENOENT
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 11 Jul 2022 10:02:04 +0000 (12:02 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 11 Jul 2022 12:08:52 +0000 (14:08 +0200)
src/libsystemd/sd-device/sd-device.c

index aaf951ced89863f3aa5807c476c712a0abe91d19..62531b9564b7e2120cd228c30d5ff8bc6f0e0a11 100644 (file)
@@ -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;