From 469ff6b40e06b40860fa96c05a47ef08af3c97e1 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Tue, 26 Mar 2024 18:55:19 +0800 Subject: core/service: remove redundant Unit.type check SOCKET(u) returns NULL if the type doesn't match. --- src/core/service.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/core/service.c') diff --git a/src/core/service.c b/src/core/service.c index 953cb2934a..ba71f97474 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1409,10 +1409,9 @@ static int service_collect_fds( Socket *sock; int cn_fds; - if (u->type != UNIT_SOCKET) - continue; - sock = SOCKET(u); + if (!sock) + continue; cn_fds = socket_collect_fds(sock, &cfds); if (cn_fds < 0) -- cgit v1.2.3