Message ID | 20210224165045.17738-2-chrubis@suse.cz |
---|---|
State | RFC |
Headers | show |
Series | Another attempt at hardware discovery | expand |
> We need to skip the check if the path to the binary starts with '/'. Good point! Reviewed-by: Petr Vorel <pvorel@suse.cz> Kind regards, Petr
diff --git a/lib/tst_cmd.c b/lib/tst_cmd.c index 7446249f9..b73978e20 100644 --- a/lib/tst_cmd.c +++ b/lib/tst_cmd.c @@ -58,7 +58,7 @@ int tst_cmd_fds_(void (cleanup_fn)(void), char path[PATH_MAX]; - if (tst_get_path(argv[0], path, sizeof(path))) { + if (argv[0][0] != '/' && tst_get_path(argv[0], path, sizeof(path))) { if (flags & TST_CMD_TCONF_ON_MISSING) tst_brkm(TCONF, cleanup_fn, "Couldn't find '%s' in $PATH at %s:%d", argv[0], __FILE__, __LINE__);
We need to skip the check if the path to the binary starts with '/'. Signed-off-by: Cyril Hrubis <chrubis@suse.cz> --- lib/tst_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)