summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-15 14:07:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-15 14:07:17 +0000
commit330e39d5684d0b4f5b2565eaf6d991185be2ebf0 (patch)
tree8f78776324c510dae4316e407c21150a2c672799 /io.c
parente70e46a1be711b1bacee43b1922601cb2aa377e5 (diff)
io.c: no envp if no spawnve
* io.c (pipe_open): envp is not used if only spawnv is defined right now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-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) {