summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@vmware.com>2021-01-20 13:54:01 +0100
committerSusant Sahani <ssahani@vmware.com>2021-01-20 15:13:08 +0100
commite8480482ca3fe014f42e6aeb59c734d8af44432e (patch)
treebc679d595934adcca0886c069f22203b78b1d385 /src
parentudev-rules: use ordered_hashmap_ensure_put (diff)
downloadsystemd-e8480482ca3fe014f42e6aeb59c734d8af44432e.tar.xz
systemd-e8480482ca3fe014f42e6aeb59c734d8af44432e.zip
sd-device: Use hashmap_ensure_put
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-device/device-monitor.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c
index fd5900704d..72f04ee352 100644
--- a/src/libsystemd/sd-device/device-monitor.c
+++ b/src/libsystemd/sd-device/device-monitor.c
@@ -732,11 +732,7 @@ _public_ int sd_device_monitor_filter_add_match_subsystem_devtype(sd_device_moni
return -ENOMEM;
}
- r = hashmap_ensure_allocated(&m->subsystem_filter, NULL);
- if (r < 0)
- return r;
-
- r = hashmap_put(m->subsystem_filter, s, d);
+ r = hashmap_ensure_put(&m->subsystem_filter, NULL, s, d);
if (r < 0)
return r;