Message ID | 20220322030245.209032-1-zhaogongyi@huawei.com |
---|---|
State | Accepted |
Headers | show |
Series | memfd_create04: Add SAFE_CLOSE before test return | expand |
Hi! Applied, thanks.
diff --git a/testcases/kernel/syscalls/memfd_create/memfd_create04.c b/testcases/kernel/syscalls/memfd_create/memfd_create04.c index dc6e195f0..7b699b218 100644 --- a/testcases/kernel/syscalls/memfd_create/memfd_create04.c +++ b/testcases/kernel/syscalls/memfd_create/memfd_create04.c @@ -79,6 +79,8 @@ static void memfd_huge_x_controller(unsigned int n) tst_res(TPASS, "memfd_create succeeded for %s page size", tflag.h_size); + + SAFE_CLOSE(fd); } static void setup(void)
If we run the test with the option -i 511, and the ulimit of open files little than 1024, the test would fail and report: memfd_create04.c:75: TFAIL: memfd_create() failed unexpectedly: EMFILE (24) Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com> --- testcases/kernel/syscalls/memfd_create/memfd_create04.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1