From: Yu Watanabe Date: Wed, 11 May 2022 19:11:37 +0000 (+0900) Subject: sd-device-enumerator: fix inverted return value of match_initialized() X-Git-Tag: v251-rc3~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b692ad36b99909453cf4f975a346e41d6afc68a0;p=thirdparty%2Fsystemd.git sd-device-enumerator: fix inverted return value of match_initialized() 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). --- diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c index 3af9e36a5a5..39f769c35cf 100644 --- a/src/libsystemd/sd-device/device-enumerator.c +++ b/src/libsystemd/sd-device/device-enumerator.c @@ -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);