summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io.c b/io.c
index bd21de0102..be56ffc3b9 100644
--- a/io.c
+++ b/io.c
@@ -5663,7 +5663,9 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
# endif
# if !defined(HAVE_FORK)
char **args = NULL;
+# if defined(HAVE_SPAWNVE)
char **envp = NULL;
+# endif
# endif
#endif
#if !defined(HAVE_FORK)
@@ -5731,7 +5733,9 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
pid = rb_fork_async_signal_safe(&status, popen_exec, &arg, arg.eargp->redirect_fds, errmsg, sizeof(errmsg));
# else
rb_execarg_run_options(eargp, sargp, NULL, 0);
+# if defined(HAVE_SPAWNVE)
if (eargp->envp_str) envp = (char **)RSTRING_PTR(eargp->envp_str);
+# endif
while ((pid = DO_SPAWN(cmd, args, envp)) == -1) {
/* exec failed */
switch (e = errno) {