gsubprocess: Copy parent process’ environ when clearing subprocess’
commite1e73dafa6eeae3e045bf054e132c2c70ff2bcc0
authorPhilip Withnall <withnall@endlessm.com>
Thu, 30 Mar 2017 10:02:14 +0000 (30 11:02 +0100)
committerPhilip Withnall <withnall@endlessm.com>
Wed, 31 May 2017 11:07:31 +0000 (31 12:07 +0100)
tree8476e85d107f0a9aaad44d4ab313e981bcad3c57
parentc7d325733c6a3bd384df6523350d9312df5ccc92
gsubprocess: Copy parent process’ environ when clearing subprocess’

Previously, this was done at the time of spawning the subprocess, which
meant the g_subprocess_launcher_*_environ() functions could not be used
to modify the parent process’ environment.

Change the code to copy the parent process’ environment when
g_subprocess_launcher_set_environ(NULL) is called. Document the change
and add a unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=778422
gio/gsubprocesslauncher.c
gio/tests/gsubprocess.c