]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager: fix confusion when to send READY=1
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 3 Nov 2021 10:22:28 +0000 (11:22 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 3 Nov 2021 10:32:31 +0000 (11:32 +0100)
I got the logic reversed in 6d9326595592f98e8126eacb4176acd8c3516d5c.
Let's just remove the conditionalization of the status message: if we're
sending something, we might just as well always attach READY=1, the extra
few bytes don't make much of a difference.

FWIW, it seems that this bug didn't cause problems, probably because we'd send
READY=1 either from user_manager_send_ready() or from a later call to
manager_send_ready().

src/core/manager.c

index c0de6acb80396487e9631e9ae1864ed23ed645c8..61895ab09281e253eaa1099a55b6f453b8ece308 100644 (file)
@@ -3482,9 +3482,9 @@ static void manager_send_ready(Manager *m) {
                 /* Skip the notification if nothing changed. */
                 return;
 
-        r = sd_notifyf(false,
-                       "%sSTATUS=Ready.",
-                       m->ready_sent ? "READY=1\n" : "");
+        r = sd_notify(false,
+                      "READY=1\n"
+                      "STATUS=Ready.");
         if (r < 0)
                 log_full_errno(m->ready_sent ? LOG_DEBUG : LOG_WARNING, r,
                                "Failed to send readiness notification, ignoring: %m");