1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-03 13:47:04 +03:00

journal-remote: use hashmap_ensure_put

This commit is contained in:
Susant Sahani 2021-01-17 10:02:17 +01:00
parent f85f5f0dc8
commit 4bc2516856

View File

@ -483,13 +483,11 @@ static int setup_microhttpd_server(RemoteServer *s,
goto error;
}
r = hashmap_ensure_allocated(&s->daemons, &uint64_hash_ops);
if (r < 0) {
r = hashmap_ensure_put(&s->daemons, &uint64_hash_ops, &d->fd, d);
if (r == -ENOMEM) {
log_oom();
goto error;
}
r = hashmap_put(s->daemons, &d->fd, d);
if (r < 0) {
log_error_errno(r, "Failed to add daemon to hashmap: %m");
goto error;