]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: add a short comment why we simply return negative errno here on failure
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 26 Jan 2021 11:07:38 +0000 (20:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 26 Jan 2021 11:07:38 +0000 (20:07 +0900)
src/libsystemd/sd-device/sd-device.c

index a1dd5bee087785fe45e8a8b357c7a67728a7b845..9b95917574abc75d3763688ba975b0218605dd61 100644 (file)
@@ -107,6 +107,7 @@ int device_add_property_aux(sd_device *device, const char *key, const char *valu
 
                 old_value = ordered_hashmap_get2(*properties, key, (void**) &old_key);
 
+                /* ordered_hashmap_replace() does not fail when the hashmap already has the entry. */
                 r = ordered_hashmap_replace(*properties, new_key, new_value);
                 if (r < 0)
                         return r;