]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: use ordered_set_ensure_put
authorSusant Sahani <ssahani@vmware.com>
Thu, 14 Jan 2021 05:00:53 +0000 (06:00 +0100)
committerSusant Sahani <ssahani@gmail.com>
Fri, 15 Jan 2021 13:29:42 +0000 (14:29 +0100)
src/home/homed-home.c

index 7f4532e0cc7bf46ecf70869f816c2711521c26bb..38b7e20ca61fdde19fe1d1ae41b89a41b679af31 100644 (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;