diff options
author | Susant Sahani <ssahani@vmware.com> | 2021-01-20 14:13:08 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@vmware.com> | 2021-01-20 15:13:21 +0100 |
commit | c2484a75145b6264a5c3f3e07aab8736f21d36e1 (patch) | |
tree | 8ea5650e44fcfb90c4bffe1e24e9d545c3eef180 | |
parent | f656fdb6235572fd2d0b69f4fc810010d83275b5 (diff) | |
download | systemd-c2484a75145b6264a5c3f3e07aab8736f21d36e1.tar.gz |
sd-event: Use hashmap_ensure_put
-rw-r--r-- | src/libsystemd/sd-event/sd-event.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index f4ab2e4b78..010e628242 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -1723,10 +1723,6 @@ static int event_make_inotify_data( fd = fd_move_above_stdio(fd); - r = hashmap_ensure_allocated(&e->inotify_data, &uint64_hash_ops); - if (r < 0) - return r; - d = new(struct inotify_data, 1); if (!d) return -ENOMEM; @@ -1737,7 +1733,7 @@ static int event_make_inotify_data( .priority = priority, }; - r = hashmap_put(e->inotify_data, &d->priority, d); + r = hashmap_ensure_put(&e->inotify_data, &uint64_hash_ops, &d->priority, d); if (r < 0) { d->fd = safe_close(d->fd); free(d); |