mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
core: transaction - use hashmap_ensure_put
This commit is contained in:
@@ -648,11 +648,7 @@ static int transaction_apply(
|
||||
assert(!j->transaction_prev);
|
||||
assert(!j->transaction_next);
|
||||
|
||||
r = hashmap_ensure_allocated(&m->jobs, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = hashmap_put(m->jobs, UINT32_TO_PTR(j->id), j);
|
||||
r = hashmap_ensure_put(&m->jobs, NULL, UINT32_TO_PTR(j->id), j);
|
||||
if (r < 0)
|
||||
goto rollback;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user