1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

udevd: Use hashmap_ensure_put

This commit is contained in:
Susant Sahani 2021-01-14 07:18:59 +01:00 committed by Susant Sahani
parent 4f38ba3889
commit 92a74c4744

View File

@ -211,11 +211,7 @@ static int worker_new(struct worker **ret, Manager *manager, sd_device_monitor *
.pid = pid,
};
r = hashmap_ensure_allocated(&manager->workers, &worker_hash_op);
if (r < 0)
return r;
r = hashmap_put(manager->workers, PID_TO_PTR(pid), worker);
r = hashmap_ensure_put(&manager->workers, &worker_hash_op, PID_TO_PTR(pid), worker);
if (r < 0)
return r;