|
|
ff6046 |
From 35a23324975ac6ee0bbd3408394f992007b7a439 Mon Sep 17 00:00:00 2001
|
|
|
ff6046 |
From: Lennart Poettering <lennart@poettering.net>
|
|
|
ff6046 |
Date: Tue, 13 Nov 2018 11:59:06 +0100
|
|
|
ff6046 |
Subject: [PATCH] =?UTF-8?q?core:=20rename=20queued=5Fmessage=20=E2=86=92?=
|
|
|
ff6046 |
=?UTF-8?q?=20pending=5Freload=5Fmessage?=
|
|
|
ff6046 |
MIME-Version: 1.0
|
|
|
ff6046 |
Content-Type: text/plain; charset=UTF-8
|
|
|
ff6046 |
Content-Transfer-Encoding: 8bit
|
|
|
ff6046 |
|
|
|
ff6046 |
This field is only used for pending Reload() replies, hence let's rename
|
|
|
ff6046 |
it to be more descriptive and precise.
|
|
|
ff6046 |
|
|
|
ff6046 |
No change in behaviour.
|
|
|
ff6046 |
|
|
|
ff6046 |
(cherry picked from commit 209de5256b7ba8600c3e73a85a43b86708998d65)
|
|
|
ff6046 |
|
|
|
ff6046 |
Resolves: #1647359
|
|
|
ff6046 |
---
|
|
|
ff6046 |
src/core/dbus-manager.c | 4 ++--
|
|
|
ff6046 |
src/core/dbus.c | 12 ++++++------
|
|
|
ff6046 |
src/core/dbus.h | 2 +-
|
|
|
ff6046 |
src/core/manager.c | 6 +++---
|
|
|
ff6046 |
src/core/manager.h | 2 +-
|
|
|
ff6046 |
5 files changed, 13 insertions(+), 13 deletions(-)
|
|
|
ff6046 |
|
|
|
ff6046 |
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
|
|
|
ff6046 |
index 4ed68af1e0..d39c9b28c4 100644
|
|
|
ff6046 |
--- a/src/core/dbus-manager.c
|
|
|
ff6046 |
+++ b/src/core/dbus-manager.c
|
|
|
ff6046 |
@@ -1329,8 +1329,8 @@ static int method_reload(sd_bus_message *message, void *userdata, sd_bus_error *
|
|
|
ff6046 |
* is finished. That way the caller knows when the reload
|
|
|
ff6046 |
* finished. */
|
|
|
ff6046 |
|
|
|
ff6046 |
- assert(!m->queued_message);
|
|
|
ff6046 |
- r = sd_bus_message_new_method_return(message, &m->queued_message);
|
|
|
ff6046 |
+ assert(!m->pending_reload_message);
|
|
|
ff6046 |
+ r = sd_bus_message_new_method_return(message, &m->pending_reload_message);
|
|
|
ff6046 |
if (r < 0)
|
|
|
ff6046 |
return r;
|
|
|
ff6046 |
|
|
|
ff6046 |
diff --git a/src/core/dbus.c b/src/core/dbus.c
|
|
|
ff6046 |
index bf5917696e..256a410215 100644
|
|
|
ff6046 |
--- a/src/core/dbus.c
|
|
|
ff6046 |
+++ b/src/core/dbus.c
|
|
|
ff6046 |
@@ -47,23 +47,23 @@
|
|
|
ff6046 |
|
|
|
ff6046 |
static void destroy_bus(Manager *m, sd_bus **bus);
|
|
|
ff6046 |
|
|
|
ff6046 |
-int bus_send_queued_message(Manager *m) {
|
|
|
ff6046 |
+int bus_send_pending_reload_message(Manager *m) {
|
|
|
ff6046 |
int r;
|
|
|
ff6046 |
|
|
|
ff6046 |
assert(m);
|
|
|
ff6046 |
|
|
|
ff6046 |
- if (!m->queued_message)
|
|
|
ff6046 |
+ if (!m->pending_reload_message)
|
|
|
ff6046 |
return 0;
|
|
|
ff6046 |
|
|
|
ff6046 |
/* If we cannot get rid of this message we won't dispatch any
|
|
|
ff6046 |
* D-Bus messages, so that we won't end up wanting to queue
|
|
|
ff6046 |
* another message. */
|
|
|
ff6046 |
|
|
|
ff6046 |
- r = sd_bus_send(NULL, m->queued_message, NULL);
|
|
|
ff6046 |
+ r = sd_bus_send(NULL, m->pending_reload_message, NULL);
|
|
|
ff6046 |
if (r < 0)
|
|
|
ff6046 |
log_warning_errno(r, "Failed to send queued message: %m");
|
|
|
ff6046 |
|
|
|
ff6046 |
- m->queued_message = sd_bus_message_unref(m->queued_message);
|
|
|
ff6046 |
+ m->pending_reload_message = sd_bus_message_unref(m->pending_reload_message);
|
|
|
ff6046 |
|
|
|
ff6046 |
return 0;
|
|
|
ff6046 |
}
|
|
|
ff6046 |
@@ -1079,8 +1079,8 @@ static void destroy_bus(Manager *m, sd_bus **bus) {
|
|
|
ff6046 |
u->bus_track = sd_bus_track_unref(u->bus_track);
|
|
|
ff6046 |
|
|
|
ff6046 |
/* Get rid of queued message on this bus */
|
|
|
ff6046 |
- if (m->queued_message && sd_bus_message_get_bus(m->queued_message) == *bus)
|
|
|
ff6046 |
- m->queued_message = sd_bus_message_unref(m->queued_message);
|
|
|
ff6046 |
+ if (m->pending_reload_message && sd_bus_message_get_bus(m->pending_reload_message) == *bus)
|
|
|
ff6046 |
+ m->pending_reload_message = sd_bus_message_unref(m->pending_reload_message);
|
|
|
ff6046 |
|
|
|
ff6046 |
/* Possibly flush unwritten data, but only if we are
|
|
|
ff6046 |
* unprivileged, since we don't want to sync here */
|
|
|
ff6046 |
diff --git a/src/core/dbus.h b/src/core/dbus.h
|
|
|
ff6046 |
index 382a96da7d..f1c0fa86c0 100644
|
|
|
ff6046 |
--- a/src/core/dbus.h
|
|
|
ff6046 |
+++ b/src/core/dbus.h
|
|
|
ff6046 |
@@ -5,7 +5,7 @@
|
|
|
ff6046 |
|
|
|
ff6046 |
#include "manager.h"
|
|
|
ff6046 |
|
|
|
ff6046 |
-int bus_send_queued_message(Manager *m);
|
|
|
ff6046 |
+int bus_send_pending_reload_message(Manager *m);
|
|
|
ff6046 |
|
|
|
ff6046 |
int bus_init_private(Manager *m);
|
|
|
ff6046 |
int bus_init_api(Manager *m);
|
|
|
ff6046 |
diff --git a/src/core/manager.c b/src/core/manager.c
|
|
|
ff6046 |
index 930df4e23a..a24bfcacdf 100644
|
|
|
ff6046 |
--- a/src/core/manager.c
|
|
|
ff6046 |
+++ b/src/core/manager.c
|
|
|
ff6046 |
@@ -2078,7 +2078,7 @@ static unsigned manager_dispatch_dbus_queue(Manager *m) {
|
|
|
ff6046 |
return 0;
|
|
|
ff6046 |
|
|
|
ff6046 |
/* Anything to do at all? */
|
|
|
ff6046 |
- if (!m->dbus_unit_queue && !m->dbus_job_queue && !m->send_reloading_done && !m->queued_message)
|
|
|
ff6046 |
+ if (!m->dbus_unit_queue && !m->dbus_job_queue && !m->send_reloading_done && !m->pending_reload_message)
|
|
|
ff6046 |
return 0;
|
|
|
ff6046 |
|
|
|
ff6046 |
/* Do we have overly many messages queued at the moment? If so, let's not enqueue more on top, let's sit this
|
|
|
ff6046 |
@@ -2123,8 +2123,8 @@ static unsigned manager_dispatch_dbus_queue(Manager *m) {
|
|
|
ff6046 |
n++, budget--;
|
|
|
ff6046 |
}
|
|
|
ff6046 |
|
|
|
ff6046 |
- if (budget > 0 && m->queued_message) {
|
|
|
ff6046 |
- bus_send_queued_message(m);
|
|
|
ff6046 |
+ if (budget > 0 && m->pending_reload_message) {
|
|
|
ff6046 |
+ bus_send_pending_reload_message(m);
|
|
|
ff6046 |
n++;
|
|
|
ff6046 |
}
|
|
|
ff6046 |
|
|
|
ff6046 |
diff --git a/src/core/manager.h b/src/core/manager.h
|
|
|
ff6046 |
index ea5d425030..c7f4d66ecd 100644
|
|
|
ff6046 |
--- a/src/core/manager.h
|
|
|
ff6046 |
+++ b/src/core/manager.h
|
|
|
ff6046 |
@@ -215,7 +215,7 @@ struct Manager {
|
|
|
ff6046 |
|
|
|
ff6046 |
/* This is used during reloading: before the reload we queue
|
|
|
ff6046 |
* the reply message here, and afterwards we send it */
|
|
|
ff6046 |
- sd_bus_message *queued_message;
|
|
|
ff6046 |
+ sd_bus_message *pending_reload_message;
|
|
|
ff6046 |
|
|
|
ff6046 |
Hashmap *watch_bus; /* D-Bus names => Unit object n:1 */
|
|
|
ff6046 |
|