Skip to contentSkip to conversation

selftests: pidfd: Fix compling warnings

PATCH Superseded Li Zhijian 1 participant 1 message Sep 1, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Li Zhijian

author
#0 lore raw

PATCH 1/1 selftests: pidfd: Fix compling warnings

Fix warnings and enable Wall

---
 tools/testing/selftests/pidfd/Makefile     | 2 +-
 tools/testing/selftests/pidfd/pidfd_test.c | 2 ++
 tools/testing/selftests/pidfd/pidfd_wait.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/pidfd/Makefile +1 -1
index f4a2f28f926b..778b6cdc8aed 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-CFLAGS += -g -I../../../../usr/include/ -pthread
+CFLAGS += -g -I../../../../usr/include/ -pthread -Wall
 
 TEST_GEN_PROGS := pidfd_test pidfd_fdinfo_test pidfd_open_test \
 	pidfd_poll_test pidfd_wait pidfd_getfd_test pidfd_setns_test
tools/testing/selftests/pidfd/pidfd_test.c +2 -0
index 9a2d64901d59..d36654265b7a 100644
@@ -435,6 +435,8 @@ static int child_poll_exec_test(void *args)
 	 */
 	while (1)
 		sleep(1);
+
+	return 0;
 }
 
 static void test_pidfd_poll_exec(int use_waitpid)
tools/testing/selftests/pidfd/pidfd_wait.c +1 -1
index c3e2a3041f55..2dee6223112c 100644
@@ -148,7 +148,7 @@ static int sys_waitid(int which, pid_t pid, siginfo_t *info, int options,
 
 TEST(wait_nonblock)
 {
-	int pidfd, status = 0;
+	int pidfd = 0;
 	unsigned int flags = 0;
 	pid_t parent_tid = -1;
 	struct clone_args args = {
Signature · 1 line
1.8.3.1