tools: set cwd when spawning with sysprof-cli

This commit is contained in:
Christian Hergert
2019-07-28 12:31:07 -07:00
parent 745f4c4168
commit 8c72bafff8
6 changed files with 68 additions and 2 deletions

View File

@ -233,6 +233,7 @@ main (gint argc,
if (command != NULL || child_argv != NULL)
{
g_auto(GStrv) env = g_get_environ ();
g_autofree gchar *cwd = NULL;
gint child_argc;
if (child_argv != NULL)
@ -245,7 +246,10 @@ main (gint argc,
return EXIT_FAILURE;
}
cwd = g_get_current_dir ();
sysprof_profiler_set_spawn (profiler, TRUE);
sysprof_profiler_set_spawn_cwd (profiler, cwd);
sysprof_profiler_set_spawn_argv (profiler, (const gchar * const *)child_argv);
sysprof_profiler_set_spawn_env (profiler, (const gchar * const *)env);
}