From c3213fb95d8b6c33f9221889d1fe48ac8871df23 Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Fri, 13 May 2016 14:34:53 -0700 Subject: [PATCH] t-runner: Improved error reporting in exec. program --- tools/test-runner.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index 7e3a0fcc..7421167d 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -322,6 +322,9 @@ static pid_t execute_program(char *argv[], bool wait) int status; pid_t pid, child_pid; + if (!argv[0]) + return -1; + child_pid = fork(); if (child_pid < 0) { l_error("Failed to fork new process"); @@ -333,7 +336,8 @@ static pid_t execute_program(char *argv[], bool wait) execvp(argv[0], argv); - l_error("Failed to call execvp: %s", strerror(errno)); + l_error("Failed to call execvp for: %s. Error: %s", argv[0], + strerror(errno)); exit(EXIT_FAILURE); }