]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: manage cached sysattr values with path_hash_ops
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 6 Apr 2023 23:50:54 +0000 (08:50 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Apr 2023 19:50:04 +0000 (04:50 +0900)
As here keys are relative paths to sysattrs.

src/libsystemd/sd-device/sd-device.c

index 5d486957ceb751dd61b5259547185d17adc0cfb0..58067414cd0573fdb71ceb9b7bc39fe5011316d0 100644 (file)
@@ -2294,7 +2294,7 @@ int device_cache_sysattr_value(sd_device *device, const char *key, char *value)
                         return -ENOMEM;
         }
 
-        r = hashmap_ensure_put(&device->sysattr_values, &string_hash_ops_free_free, new_key, value);
+        r = hashmap_ensure_put(&device->sysattr_values, &path_hash_ops_free_free, new_key, value);
         if (r < 0)
                 return r;