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

Wei Gao wegao@suse.com
Fri Nov 7 01:30:24 CET 2025


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;
+		}
+	}
 
 	if (!op_token)
 		return true;
-- 
2.51.0



More information about the ltp mailing list