]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
support: Pass environ to child process
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Mon, 15 Mar 2021 11:53:30 +0000 (17:23 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Wed, 14 Apr 2021 04:59:52 +0000 (10:29 +0530)
Pass environ to posix_spawn so that the child process can inherit
environment of the test.

(cherry picked from commit e958490f8c74e660bd93c128b3bea746e268f3f6)

support/support_subprocess.c

index 838eda96ffd6eb9ab1622f9ab70b5ec655e51350..2acfc57b7e70732d3cf253fa7cf1858b343723d9 100644 (file)
@@ -84,7 +84,7 @@ support_subprogram (const char *file, char *const argv[])
   xposix_spawn_file_actions_addclose (&fa, result.stdout_pipe[1]);
   xposix_spawn_file_actions_addclose (&fa, result.stderr_pipe[1]);
 
-  result.pid = xposix_spawn (file, &fa, NULL, argv, NULL);
+  result.pid = xposix_spawn (file, &fa, NULL, argv, environ);
 
   xclose (result.stdout_pipe[1]);
   xclose (result.stderr_pipe[1]);