* SECTION:gsubprocesslauncher
* @title: GSubprocess Launcher
* @short_description: Environment options for launching a child process
+ * @include: gio/gio.h
*
* This class contains a set of options for launching child processes,
* such as where its standard input and output will be directed, the
static void
g_subprocess_launcher_init (GSubprocessLauncher *self)
{
- self->envp = g_listenv ();
+ self->envp = g_get_environ ();
#ifdef G_OS_UNIX
self->stdin_fd = -1;
/**
* g_subprocess_launcher_set_environ:
* @self: a #GSubprocess
- * @environ: the replacement environment
+ * @env: the replacement environment
*
* Replace the entire environment of processes launched from this
* launcher with the given 'environ' variable.
**/
void
g_subprocess_launcher_set_environ (GSubprocessLauncher *self,
- gchar **environ)
+ gchar **env)
{
g_strfreev (self->envp);
- self->envp = g_strdupv (environ);
+ self->envp = g_strdupv (env);
}
/**
* @argv0: Command line arguments
* @...: Continued arguments, %NULL terminated
*
- * A convenience helper for creating a #GSubprocess given a provided
- * varargs list of arguments.
+ * Creates a #GSubprocess given a provided varargs list of arguments.
*
* Since: 2.40
* Returns: (transfer full): A new #GSubprocess, or %NULL on error (and @error will be set)
g_ptr_array_add (args, (gchar *) arg);
g_ptr_array_add (args, NULL);
+ va_end (ap);
result = g_subprocess_launcher_spawnv (launcher, (const gchar * const *) args->pdata, error);
* @argv: (array zero-terminated=1) (element-type utf8): Command line arguments
* @error: Error
*
- * A convenience helper for creating a #GSubprocess given a provided
- * array of arguments.
+ * Creates a #GSubprocess given a provided array of arguments.
*
* Since: 2.40
* Returns: (transfer full): A new #GSubprocess, or %NULL on error (and @error will be set)