Skip to content

Commit 1f47718

Browse files
authored
Merge pull request #435 from aanderse/master
2 parents 185a72b + fa13cdd commit 1f47718

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/service.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,15 +2912,15 @@ void service_notify_cb(uev_t *w, void *arg, int events)
29122912
}
29132913

29142914
len = read(w->fd, buf, sizeof(buf) - 1);
2915-
if (len == -1) {
2915+
if (len <= 0) {
29162916
warn("Failed reading notification from %s", svc_ident(svc, NULL, 0));
29172917
return;
29182918
}
29192919

29202920
buf[len] = 0;
29212921

29222922
/* systemd and s6, respectively. The latter then closes the socket */
2923-
if (!strcmp(buf, "READY=1\n") || !strcmp(buf, "\n")) {
2923+
if (!strcmp(buf, "READY=1\n") || buf[len - 1] == '\n') {
29242924
/*
29252925
* native (pidfile) services are marked as started by
29262926
* the pidfile plugin.

0 commit comments

Comments
 (0)