diff options
author | Juanjo <juanjo@bitrock.com> | 2014-10-14 12:07:19 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2014-12-09 18:41:30 +0100 |
commit | ea945bf0685e6ad7955f4acc1b3039b2a20497fb (patch) | |
tree | 25a2ae1b6452eb00413f10dc3ce1a5ff1e3ea4b7 | |
parent | 691d55fecaa5b15a5df25a4b9950585f82fade51 (diff) | |
download | node-new-ea945bf0685e6ad7955f4acc1b3039b2a20497fb.tar.gz |
lib,src: fix spawnSync ignoring its 'env' option
PR-URL: https://github.com/joyent/node/pull/8546
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
-rw-r--r-- | lib/child_process.js | 1 | ||||
-rw-r--r-- | src/spawn_sync.cc | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/child_process.js b/lib/child_process.js index a37d2f2d41..6a6c61cf24 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -1264,6 +1264,7 @@ function spawnSync(/*file, args, options*/) { options.file = opts.file; options.args = opts.args; + options.envPairs = opts.envPairs; if (options.killSignal) options.killSignal = lookupSignal(options.killSignal); diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 647ce85020..bb5c606afc 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -736,9 +736,9 @@ int SyncProcessRunner::ParseOptions(Local<Value> js_value) { r = CopyJsStringArray(js_env_pairs, &env_buffer_); if (r < 0) return r; - uv_process_options_.args = reinterpret_cast<char**>(env_buffer_); - } + uv_process_options_.env = reinterpret_cast<char**>(env_buffer_); + } Local<Value> js_uid = js_options->Get(env()->uid_string()); if (IsSet(js_uid)) { if (!CheckRange<uv_uid_t>(js_uid)) |