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