[glib] gsubprocesslauncher: Clarify the behavior of set_environ()
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gsubprocesslauncher: Clarify the behavior of set_environ()
- Date: Mon, 13 Feb 2017 15:46:17 +0000 (UTC)
commit 442d64ba94d8ddae24a79d1a0eaab1e543804163
Author: Matthew Leeds <mleeds redhat com>
Date: Fri Feb 10 11:33:18 2017 -0600
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 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gio/gsubprocesslauncher.c b/gio/gsubprocesslauncher.c
index d43583a..2c148f2 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.
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]