tst_cmd: Fix exit in search for program in $PATH
PATCH 1/1 tst_cmd: Fix exit in search for program in $PATH
The check is executed before fork() so we have to do return instead of exit() otherwise we exit the library process.
Fixes 105d283bc ("lib/tst_cmd_*(): Search for program in $PATH")
Signed-off-by Cyril Hrubis <[email protected]>
--- lib/tst_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/tst_cmd.c +1 -1
@@ -64,7 +64,7 @@ int tst_cmd_fds_(void (cleanup_fn)(void),tst_brkm (TCONF , cleanup_fn,"Couldn't find '%s' in $PATH at %s:%d" , argv[0 ], __FILE__, __LINE__); else - _exit(255); + return 255; }pid_t pid =vfork ();
Signature · 1 line
2.24.1