diff options
author | Susant Sahani <ssahani@vmware.com> | 2021-01-17 10:02:17 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@vmware.com> | 2021-01-17 14:24:44 +0100 |
commit | 4bc2516856bce713a07d0f5f8eaae11033a383af (patch) | |
tree | f24be550719555f3fd9fd34081d62ef7027e3b06 /src/journal-remote | |
parent | core: load fragment - use hashmap_ensure_put (diff) | |
download | systemd-4bc2516856bce713a07d0f5f8eaae11033a383af.tar.xz systemd-4bc2516856bce713a07d0f5f8eaae11033a383af.zip |
journal-remote: use hashmap_ensure_put
Diffstat (limited to 'src/journal-remote')
-rw-r--r-- | src/journal-remote/journal-remote-main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index af8cde7eef..b00151c32e 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -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; |