summaryrefslogtreecommitdiff
path: root/android/system-emulator.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-11-01 03:40:05 -0700
committerMarcel Holtmann <marcel@holtmann.org>2013-11-01 03:40:05 -0700
commit3ac9589731415bce09b361963f384c5b1d949d7f (patch)
tree8c524d515a03db4fe92b404c6350c9cd173b778c /android/system-emulator.c
parent86691b3a573e90c8040ba5b8c0abf039a9da5270 (diff)
downloadbluez-3ac9589731415bce09b361963f384c5b1d949d7f.tar.gz
android: Run through valgrind with the system-emulator
Diffstat (limited to 'android/system-emulator.c')
-rw-r--r--android/system-emulator.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/android/system-emulator.c b/android/system-emulator.c
index 8ca4fe1d5..7d1754637 100644
--- a/android/system-emulator.c
+++ b/android/system-emulator.c
@@ -46,12 +46,21 @@ static pid_t daemon_pid = -1;
static void ctl_start(void)
{
- char *prg_argv[1] = { NULL };
char prg_name[PATH_MAX + 1];
+ char *prg_argv[3];
+ char *prg_envp[3];
pid_t pid;
snprintf(prg_name, sizeof(prg_name), "%s/%s", exec_dir, "bluetoothd");
+ prg_argv[0] = "/usr/bin/valgrind";
+ prg_argv[1] = prg_name;
+ prg_argv[2] = NULL;
+
+ prg_envp[0] = "G_SLICE=always-malloc";
+ prg_envp[1] = "G_DEBUG=gc-friendly";
+ prg_envp[2] = NULL;
+
printf("Starting %s\n", prg_name);
pid = fork();
@@ -61,7 +70,7 @@ static void ctl_start(void)
}
if (pid == 0) {
- execv(prg_name, prg_argv);
+ execve(prg_argv[0], prg_argv, prg_envp);
exit(0);
}