manager: fix confusion when to send READY=1

I got the logic reversed in 6d93265955.
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().
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-11-03 11:32:31 +01:00
parent d4341b76d0
commit 028f7d3ac6
+3 -3
View 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");