From: Yu Watanabe Date: Tue, 26 Jan 2021 11:07:38 +0000 (+0900) Subject: sd-device: add a short comment why we simply return negative errno here on failure X-Git-Tag: v248-rc1~251^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=327379f5f299d2c7cf174494c430d0643723a309;p=thirdparty%2Fsystemd.git sd-device: add a short comment why we simply return negative errno here on failure --- diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index a1dd5bee087..9b95917574a 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -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;