]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libseccomp: fix build error
authorMatteo Croce <teknoraver@meta.com>
Thu, 25 Sep 2025 19:48:26 +0000 (21:48 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Sep 2025 22:19:29 +0000 (07:19 +0900)
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

index a26507ff64db3b00cfc01818ca2430f9c907984c..1856a5b229d973a817b5640d955de3883f9941c6 100644 (file)
@@ -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;