From 330e39d5684d0b4f5b2565eaf6d991185be2ebf0 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 15 Jan 2013 14:07:17 +0000 Subject: 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 --- io.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'io.c') 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) { -- cgit v1.2.3