Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/tst_checkpoint.c: Replace SAFE_CLOSE with SAFE_UNLINK
@ 2021-04-29 14:22 Zhao Gongyi
  2021-04-30  9:16 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Zhao Gongyi @ 2021-04-29 14:22 UTC (permalink / raw)
  To: ltp

When we call tst_checkpoint_init and set the cleanup_fn to NULL, the file
checkpoint_futex_base_file might be left over.

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
 lib/tst_checkpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_checkpoint.c b/lib/tst_checkpoint.c
index 9e9dcf9e6..3360ab07b 100644
--- a/lib/tst_checkpoint.c
+++ b/lib/tst_checkpoint.c
@@ -78,7 +78,7 @@ void tst_checkpoint_init(const char *file, const int lineno,

 	tst_max_futexes = page_size / sizeof(uint32_t);

-	SAFE_CLOSE(cleanup_fn, fd);
+	SAFE_UNLINK(cleanup_fn, "checkpoint_futex_base_file");
 }

 int tst_checkpoint_wait(unsigned int id, unsigned int msec_timeout)
--
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-30  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-29 14:22 [LTP] [PATCH] lib/tst_checkpoint.c: Replace SAFE_CLOSE with SAFE_UNLINK Zhao Gongyi
2021-04-30  9:16 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox