mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
network: address - use ordered_hashmap_ensure_put
This commit is contained in:
parent
9d6bb21f37
commit
28d9587be5
@ -94,11 +94,7 @@ static int address_new_static(Network *network, const char *filename, unsigned s
|
|||||||
address->network = network;
|
address->network = network;
|
||||||
address->section = TAKE_PTR(n);
|
address->section = TAKE_PTR(n);
|
||||||
|
|
||||||
r = ordered_hashmap_ensure_allocated(&network->addresses_by_section, &network_config_hash_ops);
|
r = ordered_hashmap_ensure_put(&network->addresses_by_section, &network_config_hash_ops, address->section, address);
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
r = ordered_hashmap_put(network->addresses_by_section, address->section, address);
|
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user