diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-03-08 18:00:49 -0800 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-03-08 18:00:49 -0800 |
commit | 55888bfd62a48ee900be3e378d70d9ef8adf74ab (patch) | |
tree | f065e55adbd4d10f169f4299ab5c377829849c75 /tools | |
parent | 8e1892cc9217afcb82fd5ab50cfcbbe7b69b35ac (diff) |
test-runner: Fix -l/--emulator
This fixes -l/--emulator not able to start depending on what parameters
are given as it was not setting the directory properly.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/test-runner.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/test-runner.c b/tools/test-runner.c index 3dea38bc6e..87a6ba9585 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -609,13 +609,18 @@ static const char *btvirt_table[] = { NULL }; -static pid_t start_btvirt(void) +static pid_t start_btvirt(const char *home) { const char *btvirt = NULL; char *argv[3], *envp[2]; pid_t pid; int i; + if (chdir(home + 5) < 0) { + perror("Failed to change home directory for daemon"); + return -1; + } + for (i = 0; btvirt_table[i]; i++) { struct stat st; @@ -690,7 +695,7 @@ static void run_command(char *cmdname, char *home) monitor_pid = -1; if (start_emulator) - emulator_pid = start_btvirt(); + emulator_pid = start_btvirt(home); else emulator_pid = -1; |