gsubprocesslauncher: Clarify the behavior of set_environ()

GNOME Builder's code was assuming that setting the launcher's
environ to NULL makes the subprocess have an empty environment, but in
fact the parent process's variables are still inherited because execv is
used instead of execve when envp is NULL. This commit clarifies the
documentation to make the behavior clear.

https://bugzilla.gnome.org/show_bug.cgi?id=778422
This commit is contained in:
Matthew Leeds 2017-02-10 11:33:18 -06:00
parent e6b6a33fa0
commit 442d64ba94

View File

@ -240,6 +240,9 @@ g_subprocess_launcher_new (GSubprocessFlags flags)
* As an alternative, you can use g_subprocess_launcher_setenv(),
* g_subprocess_launcher_unsetenv(), etc.
*
* Pass %NULL to inherit the parent process' environment. Pass an
* empty array to set an empty environment.
*
* On UNIX, all strings in this array can be arbitrary byte strings.
* On Windows, they should be in UTF-8.
*