Diff between adbf8608a6494553b3d761a40d81bef84f5198e7 and 4e8fc7499210287e6b4bf842d3de62f287bba801

Changed Files

File Additions Deletions Status
tools/test-runner.c +7 -5 modified

Full Patch

diff --git a/tools/test-runner.c b/tools/test-runner.c
index 25ff521..8caf351 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -219,11 +219,7 @@ static void start_qemu(void)
 	else
 		snprintf(initcmd, sizeof(initcmd), "%s/%s", cwd, own_binary);
 
-	if (test_argv[0][0] == '/')
-		pos = snprintf(testargs, sizeof(testargs), "%s", test_argv[0]);
-	else
-		pos = snprintf(testargs, sizeof(testargs), "%s/%s",
-							cwd, test_argv[0]);
+	pos = snprintf(testargs, sizeof(testargs), "%s", test_argv[0]);
 
 	for (i = 1; i < test_argc; i++) {
 		int len = sizeof(testargs) - pos;
@@ -293,6 +289,12 @@ static void run_command(char *cmdname, char *home)
 	}
 
 	if (pid == 0) {
+		if (home) {
+			printf("Changing into directory %s\n", home + 5);
+			if (chdir(home + 5) < 0)
+				perror("Failed to change directory");
+		}
+
 		execve(argv[0], argv, envp);
 		exit(EXIT_SUCCESS);
 	}