From eadd01da1f2877f8169da108f5897f84e596edd9 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 6 Jul 2025 15:46:57 +0200 Subject: [PATCH] Fix double-close, found by Coverity Scan Signed-off-by: Joachim Wiberg --- src/service.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }