diff --git a/src/service.c b/src/service.c index 8bb75810..673d8799 100644 --- a/src/service.c +++ b/src/service.c @@ -721,12 +721,12 @@ static int service_start(svc_t *svc) } /* fallthrough */ case SVC_NOTIFY_S6: - close(fd); /* client-end of pipefd for s6 notify */ + if (svc->notify == SVC_NOTIFY_S6) + close(fd); /* client-end of pipefd for s6 notify */ + result = uev_io_init(ctx, &svc->notify_watcher, service_notify_cb, svc, sd, UEV_READ); if (result < 0) { err(1, "%s: failed setting up notify callback", svc_ident(svc, NULL, 0)); - if (svc->notify == SVC_NOTIFY_S6) - close(fd); close(sd); break; }