[kdbus] Update kdbus interface header (commit: b620b72c9127) 14/10/16
[platform/upstream/glib.git] / gio / gsubprocesslauncher.c
index 96f8454..fbcbf6a 100644 (file)
@@ -18,6 +18,7 @@
  * 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
@@ -173,7 +174,7 @@ g_subprocess_launcher_finalize (GObject *object)
 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;
@@ -224,7 +225,7 @@ g_subprocess_launcher_new (GSubprocessFlags flags)
 /**
  * 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.
@@ -244,10 +245,10 @@ g_subprocess_launcher_new (GSubprocessFlags flags)
  **/
 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);
 }
 
 /**
@@ -674,8 +675,7 @@ g_subprocess_launcher_set_child_setup (GSubprocessLauncher  *self,
  * @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)
@@ -702,6 +702,7 @@ g_subprocess_launcher_spawn (GSubprocessLauncher  *launcher,
     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);
 
@@ -714,11 +715,10 @@ g_subprocess_launcher_spawn (GSubprocessLauncher  *launcher,
 /**
  * g_subprocess_launcher_spawnv:
  * @self: a #GSubprocessLauncher
- * @argv: Command line arguments
+ * @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)