From ba8801a07640205778c5a62539597c68d7bdb211 Mon Sep 17 00:00:00 2001 From: Matteo Croce Date: Thu, 25 Sep 2025 21:48:26 +0200 Subject: [PATCH] libseccomp: fix build error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When HAVE_SECCOMP is not set, a build error happens: ../src/analyze/analyze-security.c: In function ‘get_security_info’: ../src/analyze/analyze-security.c:2449:13: error: unused variable ‘r’ [-Werror=unused-variable] 2449 | int r; | ^ cc1: some warnings being treated as errors Fix it by removing the sometimes unused variable. --- src/analyze/analyze-security.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/analyze/analyze-security.c b/src/analyze/analyze-security.c index a26507ff64..1856a5b229 100644 --- a/src/analyze/analyze-security.c +++ b/src/analyze/analyze-security.c @@ -2446,8 +2446,6 @@ static int analyze_security_one(sd_bus *bus, /* Refactoring SecurityInfo so that it can make use of existing struct variables instead of reading from dbus */ static int get_security_info(Unit *u, ExecContext *c, CGroupContext *g, SecurityInfo **ret_info) { - int r; - assert(ret_info); _cleanup_(security_info_freep) SecurityInfo *info = security_info_new(); @@ -2577,8 +2575,7 @@ static int get_security_info(Unit *u, ExecContext *c, CGroupContext *g, Security info->_umask = c->umask; #if HAVE_SECCOMP - r = dlopen_libseccomp(); - if (r >= 0) { + if (dlopen_libseccomp() >= 0) { SET_FOREACH(key, c->syscall_archs) { const char *name;