core/device: use path_equal() to compare sysfs path

The hashmap Manager.devices_by_sysfs uses path_hash_ops.
Let's consistent compare function.
This commit is contained in:
Yu Watanabe
2024-12-20 10:52:57 +09:00
parent 71ec342d13
commit a7396f8364
+3 -1
View 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;