lib,src: fix spawnSync ignoring its 'env' option

PR-URL: https://github.com/joyent/node/pull/8546
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
pull/127/head
Juanjo 2014-10-14 12:07:19 +02:00 committed by Ben Noordhuis
parent 691d55feca
commit ea945bf068
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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))