From: Zbigniew Jędrzejewski-Szmek Date: Wed, 3 Nov 2021 10:22:28 +0000 (+0100) Subject: manager: fix confusion when to send READY=1 X-Git-Tag: v250-rc1~353^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=028f7d3ac6570ddf41a34ba9741798ef777ddacc;p=thirdparty%2Fsystemd.git manager: fix confusion when to send READY=1 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(). --- diff --git a/src/core/manager.c b/src/core/manager.c index c0de6acb803..61895ab0928 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -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");