diff options
author | Axel Rasmussen <axelrasmussen@google.com> | 2022-01-27 14:11:15 -0800 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2022-02-04 13:07:07 -0700 |
commit | e2aa5e650b07693477dff554053605976789fd68 (patch) | |
tree | ca1ece1e133a29cdd96047b2d5a5263462ca5b32 /tools/testing/selftests/pidfd/pidfd_wait.c | |
parent | pidfd: fix test failure due to stack overflow on some arches (diff) | |
download | wireguard-linux-e2aa5e650b07693477dff554053605976789fd68.tar.xz wireguard-linux-e2aa5e650b07693477dff554053605976789fd68.zip |
selftests: fixup build warnings in pidfd / clone3 tests
These are some trivial fixups, which were needed to build the tests with
clang and -Werror. The following issues are fixed:
- Remove various unused variables.
- In child_poll_leader_exit_test, clang isn't smart enough to realize
syscall(SYS_exit, 0) won't return, so it complains we never return
from a non-void function. Add an extra exit(0) to appease it.
- In test_pidfd_poll_leader_exit, ret may be branched on despite being
uninitialized, if we have !use_waitpid. Initialize it to zero to get
the right behavior in that case.
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/pidfd/pidfd_wait.c')
-rw-r--r-- | tools/testing/selftests/pidfd/pidfd_wait.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/testing/selftests/pidfd/pidfd_wait.c b/tools/testing/selftests/pidfd/pidfd_wait.c index be2943f072f6..17999e082aa7 100644 --- a/tools/testing/selftests/pidfd/pidfd_wait.c +++ b/tools/testing/selftests/pidfd/pidfd_wait.c @@ -39,7 +39,7 @@ static int sys_waitid(int which, pid_t pid, siginfo_t *info, int options, TEST(wait_simple) { - int pidfd = -1, status = 0; + int pidfd = -1; pid_t parent_tid = -1; struct clone_args args = { .parent_tid = ptr_to_u64(&parent_tid), @@ -47,7 +47,6 @@ TEST(wait_simple) .flags = CLONE_PIDFD | CLONE_PARENT_SETTID, .exit_signal = SIGCHLD, }; - int ret; pid_t pid; siginfo_t info = { .si_signo = 0, @@ -88,7 +87,7 @@ TEST(wait_simple) TEST(wait_states) { - int pidfd = -1, status = 0; + int pidfd = -1; pid_t parent_tid = -1; struct clone_args args = { .parent_tid = ptr_to_u64(&parent_tid), |