From a7396f83649478e13be1e92ea7cdafc34f3e6434 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 17 Dec 2024 01:42:16 +0900 Subject: [PATCH] core/device: use path_equal() to compare sysfs path The hashmap Manager.devices_by_sysfs uses path_hash_ops. Let's consistent compare function. --- src/core/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/device.c b/src/core/device.c index 91ffe458dc0..85b94e2d60c 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -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;