From a19b0d594b95ae49e1cfa99dfe874268119bf146 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 28 Jun 2021 13:43:03 -0700 Subject: [PATCH] test-runner: Use src/main.conf if available This makes use of src/main.conf as configuration file that way custom options can be applied while running the daemon. --- tools/test-runner.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index 96de7034e..21897b6f4 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -468,8 +468,9 @@ static const char *daemon_table[] = { static pid_t start_bluetooth_daemon(const char *home) { const char *daemon = NULL; - char *argv[3], *envp[2]; + char *argv[5], *envp[2]; pid_t pid; + struct stat st; int i; if (chdir(home + 5) < 0) { @@ -478,7 +479,6 @@ static pid_t start_bluetooth_daemon(const char *home) } for (i = 0; daemon_table[i]; i++) { - struct stat st; if (!stat(daemon_table[i], &st)) { daemon = daemon_table[i]; @@ -497,6 +497,12 @@ static pid_t start_bluetooth_daemon(const char *home) argv[1] = "--nodetach"; argv[2] = NULL; + if (!stat("src/main.conf", &st)) { + argv[2] = "-f"; + argv[3] = "src/main.conf"; + argv[4] = NULL; + } + envp[0] = "DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket"; envp[1] = NULL; -- 2.47.3