[LTP] [PATCH v4 1/4] tst_cmd.c: Check brk_nosupp when tst_get_path failed

Petr Vorel pvorel@suse.cz
Fri Nov 7 11:33:30 CET 2025


Hi Wei,

> Fixes: 257394e4e3 ("Filter mkfs version in tst_fs")
> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  lib/tst_cmd.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)

> diff --git a/lib/tst_cmd.c b/lib/tst_cmd.c
> index 2faf7c743..716029c9b 100644
> --- a/lib/tst_cmd.c
> +++ b/lib/tst_cmd.c
> @@ -265,8 +265,14 @@ bool tst_check_cmd(const char *cmd, const int brk_nosupp)
>  	version_token = strtok_r(NULL, " ", &next);
>  	str = strtok_r(NULL, " ", &next);

> -	if (tst_get_path(cmd_token, path, sizeof(path)))
> -		tst_brkm(TCONF, NULL, "Couldn't find '%s' in $PATH", cmd_token);
> +	if (tst_get_path(cmd_token, path, sizeof(path))) {
> +		if (brk_nosupp) {
> +			tst_brkm(TCONF, NULL, "Couldn't find '%s' in $PATH", cmd_token);
> +		} else {
> +			tst_resm(TCONF, "Couldn't find '%s' in $PATH", cmd_token);
> +			return 1;

Function now returns 'bool', therefore 'true' or 'false' should be returned.
IMHO this should be false, therefore I resent it:
https://lore.kernel.org/ltp/20251107102939.1111074-3-pvorel@suse.cz/

and set this patch "changes requested".

Also, I found a fix in the change I introduced, therefore send a patch which
fixes it:
https://lore.kernel.org/ltp/20251107102939.1111074-2-pvorel@suse.cz/

Kind regards,
Petr


More information about the ltp mailing list