From: Zbigniew Jędrzejewski-Szmek Date: Wed, 3 Nov 2021 10:05:23 +0000 (+0100) Subject: journald: modernize code to send notifications X-Git-Tag: v250-rc1~353^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7737416f5ecdd04d999d000f0d328185d796c4e;p=thirdparty%2Fsystemd.git journald: modernize code to send notifications No change except making things a bit less verbose. --- diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 7aa734d2d36..fc7bdb87372 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -1764,13 +1764,10 @@ static int dispatch_notify_event(sd_event_source *es, int fd, uint32_t revents, * there's something to send it will be turned on again. */ if (!s->sent_notify_ready) { - static const char p[] = - "READY=1\n" - "STATUS=Processing requests..."; - ssize_t l; + static const char p[] = "READY=1\n" + "STATUS=Processing requests..."; - l = send(s->notify_fd, p, strlen(p), MSG_DONTWAIT); - if (l < 0) { + if (send(s->notify_fd, p, strlen(p), MSG_DONTWAIT) < 0) { if (errno == EAGAIN) return 0; @@ -1781,14 +1778,9 @@ static int dispatch_notify_event(sd_event_source *es, int fd, uint32_t revents, log_debug("Sent READY=1 notification."); } else if (s->send_watchdog) { + static const char p[] = "WATCHDOG=1"; - static const char p[] = - "WATCHDOG=1"; - - ssize_t l; - - l = send(s->notify_fd, p, strlen(p), MSG_DONTWAIT); - if (l < 0) { + if (send(s->notify_fd, p, strlen(p), MSG_DONTWAIT) < 0) { if (errno == EAGAIN) return 0;