[LTP] [PATCH] syscalls/open05: Move cleanup() to the end of test

Zhao Gongyi zhaogongyi@huawei.com
Sun Apr 25 11:19:59 CEST 2021


When the test run with the option of '-i', we need to move
cleanup() to the end of test, otherwist the test will fail,
and report: "TFAIL  :  open05.c:85: Expected EACCES got 2".

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
 testcases/kernel/syscalls/open/open05.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/open/open05.c b/testcases/kernel/syscalls/open/open05.c
index 051aec3b3..f5098be2d 100644
--- a/testcases/kernel/syscalls/open/open05.c
+++ b/testcases/kernel/syscalls/open/open05.c
@@ -103,11 +103,10 @@ int main(int ac, char **av)
 				tst_resm(TFAIL, "Failures reported above");

 			close(fd);
-			cleanup();
-
 		}
 	}

+	cleanup();
 	tst_exit();
 }

--
2.17.1



More information about the ltp mailing list