mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 00:51:24 +03:00
sd-event: Use hashmap_ensure_put
This commit is contained in:
parent
639deab187
commit
f656fdb623
@ -629,10 +629,6 @@ static int event_make_signal_data(
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
r = hashmap_ensure_allocated(&e->signal_data, &uint64_hash_ops);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
d = new(struct signal_data, 1);
|
||||
if (!d)
|
||||
return -ENOMEM;
|
||||
@ -643,7 +639,7 @@ static int event_make_signal_data(
|
||||
.priority = priority,
|
||||
};
|
||||
|
||||
r = hashmap_put(e->signal_data, &d->priority, d);
|
||||
r = hashmap_ensure_put(&e->signal_data, &uint64_hash_ops, &d->priority, d);
|
||||
if (r < 0) {
|
||||
free(d);
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user