* [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* Re: [LTP] syscalls/mmap09: Drop hardcoded /tmp path
2026-04-26 3:58 [LTP] [PATCH] syscalls/mmap09: Drop hardcoded /tmp path Darren Chang via ltp
@ 2026-04-26 5:42 ` linuxtestproject.agent
2026-04-27 2:41 ` [LTP] [PATCH] " Li Wang
1 sibling, 0 replies; 3+ messages in thread
From: linuxtestproject.agent @ 2026-04-26 5:42 UTC (permalink / raw)
To: Darren Chang; +Cc: ltp, LTP AI Reviewer
Hi Darren,
On Sun, 26 Apr 2026, Darren Chang wrote:
> syscalls/mmap09: Drop hardcoded /tmp path
> - fd = SAFE_OPEN("/tmp/mmaptest", O_RDWR | O_CREAT, 0666);
> + fd = SAFE_OPEN("mmaptest", O_RDWR | O_CREAT, 0666);
Correct fix — .needs_tmpdir = 1 already chdirs into the temp directory,
so the relative path is the right approach.
Reviewed-by: LTP AI Reviewer <ltp-ai@noreply.github.com>
Pre-existing issues noticed in the surrounding code (not introduced
by this patch):
- mmap09.c:57 — cleanup() guards SAFE_CLOSE with `if (fd)`, but fd is a
static int that defaults to 0 (stdin). Use `if (fd >= 0)` with fd
initialized to -1.
---
Note:
Our agent completed the review of the patch.
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [LTP] [PATCH] syscalls/mmap09: Drop hardcoded /tmp path
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 ` Li Wang
1 sibling, 0 replies; 3+ messages in thread
From: Li Wang @ 2026-04-27 2:41 UTC (permalink / raw)
To: Darren Chang; +Cc: ltp
Patch merged, thanks!
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [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