]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
various daemons: emit Stopping... notification before destructing the manager object
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 2 Jul 2020 12:56:34 +0000 (14:56 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 2 Jul 2020 15:12:23 +0000 (17:12 +0200)
This is mostly cosmetic, but let's reorder the destructors so that
we do the final sd_notify() call before we run the destructor for
the manager object.

src/home/homed.c
src/journal-remote/journal-remote-main.c
src/journal-remote/journal-upload.c
src/network/networkd.c
src/network/wait-online/wait-online.c
src/resolve/resolved.c
src/timesync/timesyncd.c
src/userdb/userdbd.c

index 2fd3b65d8983d255c26c98b21fbcb9805f3d0a8b..ed8404d7e3da2585921877df3bea812185a99b16 100644 (file)
@@ -13,8 +13,8 @@
 #include "signal-util.h"
 
 static int run(int argc, char *argv[]) {
-        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         _cleanup_(manager_freep) Manager *m = NULL;
+        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         int r;
 
         log_setup_service();
index f82d188a8c64767c7bfce68e576fc74d5e61efa3..273fdf9196ec0417e77e4ed7c0fed3ec9c3636cd 100644 (file)
@@ -1104,8 +1104,8 @@ static int load_certificates(char **key, char **cert, char **trust) {
 }
 
 static int run(int argc, char **argv) {
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         _cleanup_(journal_remote_server_destroy) RemoteServer s = {};
+        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         _cleanup_free_ char *key = NULL, *cert = NULL, *trust = NULL;
         int r;
 
index e169a27eb3c7df8440c0a48507510cfbb3a383f5..13ca90f957f6c4eb3812a423aaf1866a6a5a27e9 100644 (file)
@@ -815,8 +815,8 @@ static int open_journal(sd_journal **j) {
 }
 
 static int run(int argc, char **argv) {
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         _cleanup_(destroy_uploader) Uploader u = {};
+        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         bool use_journal;
         int r;
 
index 35f22fea8014338d6a860a21277427330244b378..445aee16ad0435b4f7361cb6098dac5d859837dc 100644 (file)
@@ -17,8 +17,8 @@
 #include "user-util.h"
 
 static int run(int argc, char *argv[]) {
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         _cleanup_(manager_freep) Manager *m = NULL;
+        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         int r;
 
         log_setup_service();
index 17ed5d38cfe3de6bd53344cc7f391f90e9f61c13..cfd9093f1a3e954b609736ab85adf9994855214f 100644 (file)
@@ -183,8 +183,8 @@ static int parse_argv(int argc, char *argv[]) {
 }
 
 static int run(int argc, char *argv[]) {
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         _cleanup_(manager_freep) Manager *m = NULL;
+        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         int r;
 
         log_setup_service();
index 566b950a637a1f486bdc7f7f0a610d28fb5d37ae..16477f28d69e73d30638689a81a76f254ab6c639 100644 (file)
@@ -22,8 +22,8 @@
 #include "user-util.h"
 
 static int run(int argc, char *argv[]) {
-        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         _cleanup_(manager_freep) Manager *m = NULL;
+        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         int r;
 
         log_setup_service();
index e56e09ca8cec5255a83a9531530b53a8654ab4e6..4f514d536d0b73a00e6eecbd359711f394d46ff5 100644 (file)
@@ -89,8 +89,8 @@ settime:
 }
 
 static int run(int argc, char *argv[]) {
-        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         _cleanup_(manager_freep) Manager *m = NULL;
+        _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
         const char *user = "systemd-timesync";
         uid_t uid, uid_current;
         gid_t gid;
index 978fd1d7886223763e1aba953aae128633b08b53..dbc285e61aac1b0224968c208836e39e2d769069 100644 (file)
@@ -20,8 +20,8 @@
  */
 
 static int run(int argc, char *argv[]) {
-        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         _cleanup_(manager_freep) Manager *m = NULL;
+        _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
         int r;
 
         log_setup_service();