Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/landlock: Properly close a file descriptor

Add a missing close(srv_fd) call, and use EXPECT_EQ() to check the
result.

Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Fixes: f83d51a5bdfe ("selftests/landlock: Check IOCTL restrictions for named UNIX domain sockets")
Link: https://lore.kernel.org/r/20260101134102.25938-2-gnoack3000@gmail.com
[mic: Use EXPECT_EQ() and update commit message]
Signed-off-by: Mickaël Salaün <mic@digikod.net>

authored by

Günther Noack and committed by
Mickaël Salaün
15e8d739 ef4536f1

+2 -1
+2 -1
tools/testing/selftests/landlock/fs_test.c
··· 4399 4399 /* FIONREAD and other IOCTLs should not be forbidden. */ 4400 4400 EXPECT_EQ(0, test_fionread_ioctl(cli_fd)); 4401 4401 4402 - ASSERT_EQ(0, close(cli_fd)); 4402 + EXPECT_EQ(0, close(cli_fd)); 4403 + EXPECT_EQ(0, close(srv_fd)); 4403 4404 } 4404 4405 4405 4406 /* clang-format off */