From f656fdb6235572fd2d0b69f4fc810010d83275b5 Mon Sep 17 00:00:00 2001 From: Susant Sahani Date: Wed, 20 Jan 2021 13:58:00 +0100 Subject: [PATCH] sd-event: Use hashmap_ensure_put --- src/libsystemd/sd-event/sd-event.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index 3f1a6776fe4..f4ab2e4b788 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -629,10 +629,6 @@ static int event_make_signal_data( return 0; } } else { - r = hashmap_ensure_allocated(&e->signal_data, &uint64_hash_ops); - if (r < 0) - return r; - d = new(struct signal_data, 1); if (!d) return -ENOMEM; @@ -643,7 +639,7 @@ static int event_make_signal_data( .priority = priority, }; - r = hashmap_put(e->signal_data, &d->priority, d); + r = hashmap_ensure_put(&e->signal_data, &uint64_hash_ops, &d->priority, d); if (r < 0) { free(d); return r;