diff options
author | Mike Yuan <me@yhndnzj.com> | 2025-01-11 17:10:43 +0100 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2025-01-13 16:24:44 +0100 |
commit | e3d37628aabff92e4b756e63ef0a6cd4569ce743 (patch) | |
tree | 042b42ac122eccf1898b91f59961d7ca2c18e2b4 /src/home | |
parent | shared/bus-util: move bus_message_read_id128() to bus-message-util (diff) | |
download | systemd-e3d37628aabff92e4b756e63ef0a6cd4569ce743.tar.xz systemd-e3d37628aabff92e4b756e63ef0a6cd4569ce743.zip |
shared/bus-util: move bus_message_hash_ops to bus-message-util
Diffstat (limited to 'src/home')
-rw-r--r-- | src/home/homed-manager-bus.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/home/homed-manager-bus.c b/src/home/homed-manager-bus.c index 69c7680b9e..08c917aee2 100644 --- a/src/home/homed-manager-bus.c +++ b/src/home/homed-manager-bus.c @@ -4,6 +4,7 @@ #include "alloc-util.h" #include "bus-common-errors.h" +#include "bus-message-util.h" #include "bus-polkit.h" #include "format-util.h" #include "home-util.h" @@ -704,17 +705,17 @@ static int method_rebalance(sd_bus_message *message, void *userdata, sd_bus_erro int r; r = manager_schedule_rebalance(m, /* immediately= */ true); - if (r == 0) - return sd_bus_reply_method_errorf(message, BUS_ERROR_REBALANCE_NOT_NEEDED, "No home directories need rebalancing."); if (r < 0) return r; + if (r == 0) + return sd_bus_reply_method_errorf(message, BUS_ERROR_REBALANCE_NOT_NEEDED, "No home directories need rebalancing."); /* Keep a reference to this message, so that we can reply to it once we are done */ - r = set_ensure_put(&m->rebalance_queued_method_calls, &bus_message_hash_ops, message); + r = set_ensure_consume(&m->rebalance_queued_method_calls, &bus_message_hash_ops, sd_bus_message_ref(message)); if (r < 0) return log_error_errno(r, "Failed to track rebalance bus message: %m"); + assert(r > 0); - sd_bus_message_ref(message); return 1; } |