]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device-enumerator: fix inverted return value of match_initialized()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 11 May 2022 19:11:37 +0000 (04:11 +0900)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 May 2022 07:31:23 +0000 (09:31 +0200)
Fixes a bug introduced by d8b50e5df7e01983279e70c6d970fb60d053df97.

Fixes https://github.com/systemd/systemd/pull/22662#issuecomment-1124163773.
Fixes RHBZ#2083374 (https://bugzilla.redhat.com/show_bug.cgi?id=2083374).

src/libsystemd/sd-device/device-enumerator.c

index 3af9e36a5a52a52619a79e350e10f9f3a36ec05a..39f769c35cf65bd240363219a1f069b9916dd8fa 100644 (file)
@@ -537,12 +537,12 @@ static int match_initialized(sd_device_enumerator *enumerator, sd_device *device
                         return true;
 
                 if (sd_device_get_devnum(device, NULL) >= 0)
-                        return true;
+                        return false;
 
                 if (sd_device_get_ifindex(device, NULL) >= 0)
-                        return true;
+                        return false;
 
-                return false;
+                return true;
         }
 
         return (enumerator->match_initialized == MATCH_INITIALIZED_NO) == (r == 0);