diff options
author | Susant Sahani <ssahani@vmware.com> | 2021-01-14 06:33:52 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@gmail.com> | 2021-01-15 14:29:42 +0100 |
commit | 967d72ed93cf388bef947bee4c5b74c96832da29 (patch) | |
tree | 265600d6f60229009f981909a9d03174457fd535 /src/network | |
parent | 03d2d9e18fc5f577f9aef4ffa708406ef877ca35 (diff) | |
download | systemd-967d72ed93cf388bef947bee4c5b74c96832da29.tar.gz |
network: link - use hashmap_ensure_put
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-link.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index aa82576c17..6de0d7003a 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -449,11 +449,7 @@ static int link_new(Manager *manager, sd_netlink_message *message, Link **ret) { if (asprintf(&link->lldp_file, "/run/systemd/netif/lldp/%d", link->ifindex) < 0) return -ENOMEM; - r = hashmap_ensure_allocated(&manager->links, NULL); - if (r < 0) - return r; - - r = hashmap_put(manager->links, INT_TO_PTR(link->ifindex), link); + r = hashmap_ensure_put(&manager->links, NULL, INT_TO_PTR(link->ifindex), link); if (r < 0) return r; |