[LTP] execve05: add exit call when execve failed
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Fri Jun 5 07:20:22 CEST 2026
Hi Yeguojin,
On Fri, 5 Jun 2026 11:19:19 +0800, Yeguojin wrote:
> execve05: add exit call when execve failed
> + exit(EXIT_FAILURE);
After tst_res(TFAIL | TTERRNO, ...) the result is already recorded by
the framework. The child's exit code is used only to detect crashes or
unexpected termination.
Once verify_execve() returns, the framework calls tst_reap_children(),
which invokes check_child_status(). That function does:
if (WEXITSTATUS(status))
tst_brk(TBROK, "Invalid child (%i) exit value %i", ...);
So exit(EXIT_FAILURE) will produce a spurious TBROK on top of the
already-reported TFAIL. The convention in LTP is to call exit(0) after
reporting a result through tst_res() in a child process.
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