Skip to content

Commit 15e8d73

Browse files
gnoackl0kod
authored andcommitted
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: f83d51a ("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>
1 parent ef4536f commit 15e8d73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/landlock/fs_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4399,7 +4399,8 @@ TEST_F_FORK(layout1, named_unix_domain_socket_ioctl)
43994399
/* FIONREAD and other IOCTLs should not be forbidden. */
44004400
EXPECT_EQ(0, test_fionread_ioctl(cli_fd));
44014401

4402-
ASSERT_EQ(0, close(cli_fd));
4402+
EXPECT_EQ(0, close(cli_fd));
4403+
EXPECT_EQ(0, close(srv_fd));
44034404
}
44044405

44054406
/* clang-format off */

0 commit comments

Comments
 (0)