[LTP] syscalls/mmap09: Drop hardcoded /tmp path

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Sun Apr 26 07:42:14 CEST 2026


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


More information about the ltp mailing list