diff options
author | NIIBE Yutaka <[email protected]> | 2024-05-29 08:13:00 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2024-05-29 08:19:44 +0000 |
commit | fbe1f5153c3cb8b7c5de40973cceee7f639804e7 (patch) | |
tree | c9bbd781297ed6a0c0e6d78cf52ed15ae6ef989a /src/spawn-posix.c | |
parent | Cleaner semantics for _gpgrt_process_spawn without a callback. (diff) | |
download | libgpg-error-fbe1f5153c3cb8b7c5de40973cceee7f639804e7.tar.gz libgpg-error-fbe1f5153c3cb8b7c5de40973cceee7f639804e7.zip |
Fix how environment variables are specified for spawn.
* src/gpgrt-int.h (_gpgrt_spawn_actions_set_envvars)
[HAVE_W32_SYSTEM]: Assume use with GetEnvironmentStrings.
(_gpgrt_spawn_actions_set_environ) [!HAVE_W32_SYSTEM]:
New.
* src/spawn-posix.c: Follow the change.
* src/spawn-w32.c: Can specify envvars now.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src/spawn-posix.c')
-rw-r--r-- | src/spawn-posix.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/spawn-posix.c b/src/spawn-posix.c index f31b9c5..b784cc5 100644 --- a/src/spawn-posix.c +++ b/src/spawn-posix.c @@ -290,7 +290,7 @@ posix_open_null (int for_write) struct gpgrt_spawn_actions { int fd[3]; const int *except_fds; - char **env; + char **environ; void (*atfork) (void *); void *atfork_arg; }; @@ -323,8 +323,8 @@ my_exec (const char *pgmname, const char *argv[], /* Close all other files. */ _gpgrt_close_all_fds (3, act->except_fds); - if (act->env) - environ = act->env; + if (act->environ) + environ = act->environ; if (act->atfork) act->atfork (act->atfork_arg); @@ -428,9 +428,10 @@ _gpgrt_spawn_actions_release (gpgrt_spawn_actions_t act) } void -_gpgrt_spawn_actions_set_envvars (gpgrt_spawn_actions_t act, char **env) +_gpgrt_spawn_actions_set_environ (gpgrt_spawn_actions_t act, + char **environ_for_child) { - act->env = env; + act->environ = environ_for_child; } void |