diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-02-17 16:29:23 -0800 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2014-02-18 16:03:13 +0400 |
commit | 937e2e351b2450cf1e9c4d8b3e1a4e2a2def58bb (patch) | |
tree | ffa883513db02314a16e2c5267029504cd5e90c7 /lib/child_process.js | |
parent | 59baab277691dcc7d788724020084414b96de22c (diff) | |
download | node-new-937e2e351b2450cf1e9c4d8b3e1a4e2a2def58bb.tar.gz |
child_process: execFileSync stderr should inherit
If you don't set your options.stdio for execSync and execFileSync
capture and write to stderr of the parent process by default.
Fixes #7110
Diffstat (limited to 'lib/child_process.js')
-rw-r--r-- | lib/child_process.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/child_process.js b/lib/child_process.js index 1f121d901f..f606224856 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -1304,7 +1304,13 @@ function checkExecSyncError(ret) { function execFileSync(/*command, options*/) { - var ret = spawnSync.apply(null, arguments); + var opts = normalizeSpawnArguments.apply(null, arguments); + var inheritStderr = !!!opts.options.stdio; + + var ret = spawnSync(opts.file, opts.args.slice(1), opts.options); + + if (inheritStderr) + process.stderr.write(ret.stderr); var err = checkExecSyncError(ret); @@ -1318,9 +1324,14 @@ exports.execFileSync = execFileSync; function execSync(/*comand, options*/) { var opts = normalizeExecArgs.apply(null, arguments); + var inheritStderr = opts.options ? !!!opts.options.stdio : true; + var ret = spawnSync(opts.file, opts.args, opts.options); ret.cmd = opts.cmd; + if (inheritStderr) + process.stderr.write(ret.stderr); + var err = checkExecSyncError(ret); if (err) |