From 442d64ba94d8ddae24a79d1a0eaab1e543804163 Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Fri, 10 Feb 2017 11:33:18 -0600 Subject: [PATCH] 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 --- gio/gsubprocesslauncher.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gio/gsubprocesslauncher.c b/gio/gsubprocesslauncher.c index d43583af7..2c148f2f6 100644 --- a/gio/gsubprocesslauncher.c +++ b/gio/gsubprocesslauncher.c @@ -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. *