Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/mmap09: Drop hardcoded /tmp path
@ 2026-04-26  3:58 Darren Chang via ltp
  2026-04-26  5:42 ` [LTP] " linuxtestproject.agent
  2026-04-27  2:41 ` [LTP] [PATCH] " Li Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Darren Chang via ltp @ 2026-04-26  3:58 UTC (permalink / raw)
  To: ltp

In some environments (such as Android devices), the `/tmp` directory
might not exist, which causes the test to fail during setup when
trying to open `/tmp/mmaptest`.

Since this test already utilizes the new LTP API with `.needs_tmpdir = 1`,
the framework automatically creates and chdirs into a unique temporary
directory. Therefore, we can safely use a relative path for the test
file instead of hardcoding `/tmp`.

Signed-off-by: Darren Chang <chihsheng@google.com>
---
 testcases/kernel/syscalls/mmap/mmap09.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/mmap/mmap09.c b/testcases/kernel/syscalls/mmap/mmap09.c
index 8c6b514ab..f2d695268 100644
--- a/testcases/kernel/syscalls/mmap/mmap09.c
+++ b/testcases/kernel/syscalls/mmap/mmap09.c
@@ -43,7 +43,7 @@ static void verify_mmap(unsigned int nr)
 
 static void setup(void)
 {
-	fd = SAFE_OPEN("/tmp/mmaptest", O_RDWR | O_CREAT, 0666);
+	fd = SAFE_OPEN("mmaptest", O_RDWR | O_CREAT, 0666);
 
 	/* set the file to initial size */
 	SAFE_FTRUNCATE(fd, MAPSIZE);
-- 
2.54.0.rc2.544.gc7ae2d5bb8-goog


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2026-04-27  2:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-26  3:58 [LTP] [PATCH] syscalls/mmap09: Drop hardcoded /tmp path Darren Chang via ltp
2026-04-26  5:42 ` [LTP] " linuxtestproject.agent
2026-04-27  2:41 ` [LTP] [PATCH] " Li Wang

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