]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/landlock: Fix fs_test build with old libc
authorHu Yadi <hu.yadi@h3c.com>
Wed, 24 Jan 2024 02:29:08 +0000 (10:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:51:23 +0000 (09:51 +0100)
commitd7e771d85ad1818e94ae80f320cf6cbad3365223
tree2351c0761ac692bea9723411d4f735bf2c4276d4
parentbb984e0428223eae51c28eb2893eb9302f0333f9
selftests/landlock: Fix fs_test build with old libc

[ Upstream commit 40b7835e74e0383be308d528c5e0e41b3bf72ade ]

One issue comes up while building selftest/landlock/fs_test on my side
(gcc 7.3/glibc-2.28/kernel-4.19).

gcc -Wall -O2 -isystem   fs_test.c -lcap -o selftests/landlock/fs_test
fs_test.c:4575:9: error: initializer element is not constant
  .mnt = mnt_tmp,
         ^~~~~~~

Signed-off-by: Hu Yadi <hu.yadi@h3c.com>
Suggested-by: Jiao <jiaoxupo@h3c.com>
Reviewed-by: Berlin <berlin@h3c.com>
Link: https://lore.kernel.org/r/20240124022908.42100-1-hu.yadi@h3c.com
Fixes: 04f9070e99a4 ("selftests/landlock: Add tests for pseudo filesystems")
[mic: Factor out mount's data string and make mnt_tmp static]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/landlock/fs_test.c