1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

network: network -- use ordered_hashmap_ensure_put

This commit is contained in:
Susant Sahani 2021-01-18 21:11:01 +01:00
parent 28d9587be5
commit 9fa3e794ac

View File

@ -499,11 +499,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi
/* Ignore .network files that do not match the conditions. */ /* Ignore .network files that do not match the conditions. */
return 0; return 0;
r = ordered_hashmap_ensure_allocated(networks, &string_hash_ops); r = ordered_hashmap_ensure_put(networks, &string_hash_ops, network->name, network);
if (r < 0)
return r;
r = ordered_hashmap_put(*networks, network->name, network);
if (r < 0) if (r < 0)
return r; return r;