mirror of
https://github.com/systemd/systemd.git
synced 2026-08-10 17:14:31 +00:00
core: pending_freezer_{message => invocation}
Rename the field to reflect the new semantics.
This commit is contained in:
@@ -782,12 +782,12 @@ static int bus_unit_method_freezer_generic(sd_bus_message *message, void *userda
|
||||
if (r == 0)
|
||||
reply_no_delay = true;
|
||||
|
||||
if (u->pending_freezer_message) {
|
||||
if (u->pending_freezer_invocation) {
|
||||
bus_unit_send_pending_freezer_message(u, true);
|
||||
assert(!u->pending_freezer_message);
|
||||
assert(!u->pending_freezer_invocation);
|
||||
}
|
||||
|
||||
u->pending_freezer_message = sd_bus_message_ref(message);
|
||||
u->pending_freezer_invocation = sd_bus_message_ref(message);
|
||||
|
||||
if (reply_no_delay) {
|
||||
r = bus_unit_send_pending_freezer_message(u, false);
|
||||
@@ -1668,17 +1668,17 @@ int bus_unit_send_pending_freezer_message(Unit *u, bool cancelled) {
|
||||
|
||||
assert(u);
|
||||
|
||||
if (!u->pending_freezer_message)
|
||||
if (!u->pending_freezer_invocation)
|
||||
return 0;
|
||||
|
||||
if (cancelled)
|
||||
r = sd_bus_message_new_method_error(
|
||||
u->pending_freezer_message,
|
||||
u->pending_freezer_invocation,
|
||||
&reply,
|
||||
&SD_BUS_ERROR_MAKE_CONST(
|
||||
BUS_ERROR_FREEZE_CANCELLED, "Freeze operation aborted"));
|
||||
else
|
||||
r = sd_bus_message_new_method_return(u->pending_freezer_message, &reply);
|
||||
r = sd_bus_message_new_method_return(u->pending_freezer_invocation, &reply);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1686,7 +1686,7 @@ int bus_unit_send_pending_freezer_message(Unit *u, bool cancelled) {
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to send queued message, ignoring: %m");
|
||||
|
||||
u->pending_freezer_message = sd_bus_message_unref(u->pending_freezer_message);
|
||||
u->pending_freezer_invocation = sd_bus_message_unref(u->pending_freezer_invocation);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -998,8 +998,8 @@ static void destroy_bus(Manager *m, sd_bus **bus) {
|
||||
u->bus_track = sd_bus_track_unref(u->bus_track);
|
||||
|
||||
/* Get rid of pending freezer messages on this bus */
|
||||
if (u->pending_freezer_message && sd_bus_message_get_bus(u->pending_freezer_message) == *bus)
|
||||
u->pending_freezer_message = sd_bus_message_unref(u->pending_freezer_message);
|
||||
if (u->pending_freezer_invocation && sd_bus_message_get_bus(u->pending_freezer_invocation) == *bus)
|
||||
u->pending_freezer_invocation = sd_bus_message_unref(u->pending_freezer_invocation);
|
||||
}
|
||||
|
||||
/* Get rid of queued message on this bus */
|
||||
|
||||
@@ -687,7 +687,7 @@ Unit* unit_free(Unit *u) {
|
||||
u->match_bus_slot = sd_bus_slot_unref(u->match_bus_slot);
|
||||
u->bus_track = sd_bus_track_unref(u->bus_track);
|
||||
u->deserialized_refs = strv_free(u->deserialized_refs);
|
||||
u->pending_freezer_message = sd_bus_message_unref(u->pending_freezer_message);
|
||||
u->pending_freezer_invocation = sd_bus_message_unref(u->pending_freezer_invocation);
|
||||
|
||||
unit_free_requires_mounts_for(u);
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ typedef struct Unit {
|
||||
FILE *transient_file;
|
||||
|
||||
/* Freezer state */
|
||||
sd_bus_message *pending_freezer_message;
|
||||
sd_bus_message *pending_freezer_invocation;
|
||||
FreezerState freezer_state;
|
||||
|
||||
/* Job timeout and action to take */
|
||||
|
||||
Reference in New Issue
Block a user