]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/device: use path_equal() to compare sysfs path
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Dec 2024 16:42:16 +0000 (01:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 20 Dec 2024 01:52:57 +0000 (10:52 +0900)
The hashmap Manager.devices_by_sysfs uses path_hash_ops.
Let's consistent compare function.

src/core/device.c

index 91ffe458dc0e0193c0b009db14c338e078889369..85b94e2d60ca91a4311574d63ffc7779e98d407b 100644 (file)
@@ -85,7 +85,9 @@ static int device_set_sysfs(Device *d, const char *sysfs) {
         Unit *u = UNIT(ASSERT_PTR(d));
         int r;
 
-        if (streq_ptr(d->sysfs, sysfs))
+        assert(sysfs);
+
+        if (path_equal(d->sysfs, sysfs))
                 return 0;
 
         Hashmap **devices = &u->manager->devices_by_sysfs;