From 327379f5f299d2c7cf174494c430d0643723a309 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 26 Jan 2021 20:07:38 +0900 Subject: [PATCH] sd-device: add a short comment why we simply return negative errno here on failure --- src/libsystemd/sd-device/sd-device.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.47.3