homed: use ordered_set_ensure_put

This commit is contained in:
Susant Sahani
2021-01-15 14:29:42 +01:00
committed by Susant Sahani
parent 061e9fc5f1
commit 65ca9b5343
+1 -5
View File
@@ -2656,11 +2656,7 @@ int home_schedule_operation(Home *h, Operation *o, sd_bus_error *error) {
if (ordered_set_size(h->pending_operations) >= PENDING_OPERATIONS_MAX)
return sd_bus_error_setf(error, BUS_ERROR_TOO_MANY_OPERATIONS, "Too many client operations requested");
r = ordered_set_ensure_allocated(&h->pending_operations, &operation_hash_ops);
if (r < 0)
return r;
r = ordered_set_put(h->pending_operations, o);
r = ordered_set_ensure_put(&h->pending_operations, &operation_hash_ops, o);
if (r < 0)
return r;