[LTP] mmapstress06: Convert to new API

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Sat Jun 6 13:32:02 CEST 2026


Hi Wei,

On Sat, 06 Jun 2026 10:08:05 +0000, Wei Gao wrote:
> mmapstress06: Convert to new API

> +	SAFE_WAITPID(child_pid, &status, 0);
> +	child_pid = -1;
> +
> +	if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
> +		tst_res(TFAIL, "Child process failed (status: %d)", status);

The child already calls tst_res(TPASS/TFAIL, ...) directly, and
.forks_child = 1 tells the framework to propagate those results to the
parent. Checking WEXITSTATUS on top of that risks double-reporting: if a
SAFE_* macro in the child triggers tst_brk(), the framework records the
TBROK from the child and the parent then logs an additional TFAIL.

The correct pattern (per the LTP rules on child result reporting) is to
rely on tst_res() in the child and drop the exit-code check in the
parent. SAFE_WAITPID() is still needed to reap the child, but the result
is already reported:

	SAFE_WAITPID(child_pid, &status, 0);
	child_pid = -1;

Verdict: Needs revision

---
Note:

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