Message ID | 20220319074453.104636-1-zhaogongyi@huawei.com |
---|---|
State | Accepted |
Headers | show |
Series | readdir01: Add closedir before test return | expand |
Hi! Pushed, thanks.
diff --git a/testcases/kernel/syscalls/readdir/readdir01.c b/testcases/kernel/syscalls/readdir/readdir01.c index e90f50c80..d200145ea 100644 --- a/testcases/kernel/syscalls/readdir/readdir01.c +++ b/testcases/kernel/syscalls/readdir/readdir01.c @@ -59,6 +59,8 @@ static void verify_readdir(void) tst_res(TFAIL, "found %s files than were created, created: %d, found: %d", cnt > nfiles ? "more" : "less", nfiles, cnt); } + + SAFE_CLOSEDIR(test_dir); } static struct tst_test test = {
If we run the test with option -i 10000, and the ulimit of open files little than 10000, the test will fail and report: readdir01.c:48: TBROK: opendir(.) failed: EMFILE (24). Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com> --- testcases/kernel/syscalls/readdir/readdir01.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1