Adam Williamson 7d3e9e
From 8b0ebe3aa21fc343e435b7ff72cbf8565149ef00 Mon Sep 17 00:00:00 2001
Adam Williamson 7d3e9e
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Adam Williamson 7d3e9e
Date: Thu, 12 May 2022 04:11:37 +0900
Adam Williamson 7d3e9e
Subject: [PATCH] sd-device-enumerator: fix inverted return value of
Adam Williamson 7d3e9e
 match_initialized()
Adam Williamson 7d3e9e
Adam Williamson 7d3e9e
Fixes a bug introduced by d8b50e5df7e01983279e70c6d970fb60d053df97.
Adam Williamson 7d3e9e
Adam Williamson 7d3e9e
Fixes https://github.com/systemd/systemd/pull/22662#issuecomment-1124163773.
Adam Williamson 7d3e9e
Fixes RHBZ#2083374 (https://bugzilla.redhat.com/show_bug.cgi?id=2083374).
Adam Williamson 7d3e9e
---
Adam Williamson 7d3e9e
 src/libsystemd/sd-device/device-enumerator.c | 6 +++---
Adam Williamson 7d3e9e
 1 file changed, 3 insertions(+), 3 deletions(-)
Adam Williamson 7d3e9e
Adam Williamson 7d3e9e
diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c
Adam Williamson 7d3e9e
index 3af9e36a5a52..39f769c35cf6 100644
Adam Williamson 7d3e9e
--- a/src/libsystemd/sd-device/device-enumerator.c
Adam Williamson 7d3e9e
+++ b/src/libsystemd/sd-device/device-enumerator.c
Adam Williamson 7d3e9e
@@ -537,12 +537,12 @@ static int match_initialized(sd_device_enumerator *enumerator, sd_device *device
Adam Williamson 7d3e9e
                         return true;
Adam Williamson 7d3e9e
 
Adam Williamson 7d3e9e
                 if (sd_device_get_devnum(device, NULL) >= 0)
Adam Williamson 7d3e9e
-                        return true;
Adam Williamson 7d3e9e
+                        return false;
Adam Williamson 7d3e9e
 
Adam Williamson 7d3e9e
                 if (sd_device_get_ifindex(device, NULL) >= 0)
Adam Williamson 7d3e9e
-                        return true;
Adam Williamson 7d3e9e
+                        return false;
Adam Williamson 7d3e9e
 
Adam Williamson 7d3e9e
-                return false;
Adam Williamson 7d3e9e
+                return true;
Adam Williamson 7d3e9e
         }
Adam Williamson 7d3e9e
 
Adam Williamson 7d3e9e
         return (enumerator->match_initialized == MATCH_INITIALIZED_NO) == (r == 0);