From: Mike Yuan Date: Tue, 26 Mar 2024 10:55:19 +0000 (+0800) Subject: core/service: remove redundant Unit.type check X-Git-Tag: v256-rc1~392^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=469ff6b40e06b40860fa96c05a47ef08af3c97e1;p=thirdparty%2Fsystemd.git core/service: remove redundant Unit.type check SOCKET(u) returns NULL if the type doesn't match. --- diff --git a/src/core/service.c b/src/core/service.c index 953cb2934aa..ba71f974744 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)