diff options
author | Susant Sahani <ssahani@vmware.com> | 2021-01-18 21:52:58 +0100 |
---|---|---|
committer | Susant Sahani <ssahani@vmware.com> | 2021-01-18 21:52:58 +0100 |
commit | acf56b72f26609ee5431e23d4e5bbaf7f730d236 (patch) | |
tree | 5c73358c9cc74a69fb8e42f0336662aa13a66044 /src/core/transaction.c | |
parent | f334debabbb70597e04a5f5318437e2ab6f9d22e (diff) | |
download | systemd-acf56b72f26609ee5431e23d4e5bbaf7f730d236.tar.gz |
core: transaction - use hashmap_ensure_put
Diffstat (limited to 'src/core/transaction.c')
-rw-r--r-- | src/core/transaction.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/transaction.c b/src/core/transaction.c index ae77bae65e..d7388e2367 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -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; } |