]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: add a brief comment in device_cache_sysattr_value()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 20 Feb 2021 06:26:54 +0000 (15:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 20 Feb 2021 19:40:23 +0000 (04:40 +0900)
src/libsystemd/sd-device/sd-device.c

index dad87f39c9a82259ac7ccd42b4f777e18dcf54f7..8aa47f2fdd3bcbf0fc05676e8327e0556b6404a2 100644 (file)
@@ -1829,6 +1829,7 @@ static int device_cache_sysattr_value(sd_device *device, const char *key, char *
         /* This takes the reference of the input value. The input value may be NULL.
          * This replaces the value if it already exists. */
 
+        /* First, remove the old cache entry. So, we do not need to clear cache on error. */
         old_value = hashmap_remove2(device->sysattr_values, key, (void **) &new_key);
         if (!new_key) {
                 new_key = strdup(key);