Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -2912,15 +2912,15 @@ void service_notify_cb(uev_t *w, void *arg, int events)
}

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

buf[len] = 0;

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