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();
}
if (pid == 0) {
- execv(prg_name, prg_argv);
+ execve(prg_argv[0], prg_argv, prg_envp);
exit(0);
}