diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2009-10-07 01:04:27 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2009-10-07 01:08:33 +0200 |
commit | 82465fc4b1f458e0c211d280fc25be1b75982f05 (patch) | |
tree | 79ef3223db4975ab29acf5f7cc7384818183e6ae /test | |
parent | 39c61367a7d027de619aa89a43097d74ac5bc6bf (diff) | |
download | nodejs-82465fc4b1f458e0c211d280fc25be1b75982f05.tar.gz nodejs-82465fc4b1f458e0c211d280fc25be1b75982f05.tar.bz2 nodejs-82465fc4b1f458e0c211d280fc25be1b75982f05.zip |
Do not use /bin/sh to create child processes.
Instead directly call execvp(). This change is needed for the
soon-to-be-added signal handlers because the /bin/sh parent process does not
pass all signals to it's children, particularly SIGUSR1 on Linux.
The parameters of createChildProcess had to be changed slightly.
utils.exec() also has a changed implementation. A bug involving quoted
arguments was knowingly introduced into utils.exec(). Will fix later.
Diffstat (limited to 'test')
-rw-r--r-- | test/mjsunit/test-multipart.js | 2 | ||||
-rw-r--r-- | test/mjsunit/test-process-spawn-loop.js | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/test/mjsunit/test-multipart.js b/test/mjsunit/test-multipart.js index 262429fe5..020e94b25 100644 --- a/test/mjsunit/test-multipart.js +++ b/test/mjsunit/test-multipart.js @@ -44,7 +44,7 @@ var server = http.createServer(function(req, res) { }); server.listen(port); -var cmd = 'curl -H "Expect:" -F "test-field=foobar" -F test-file=@'+__filename+' http://localhost:'+port+'/'; +var cmd = 'curl -H Expect: -F test-field=foobar -F test-file=@'+__filename+' http://localhost:'+port+'/'; var result = exec(cmd).wait(); process.addListener('exit', function() { diff --git a/test/mjsunit/test-process-spawn-loop.js b/test/mjsunit/test-process-spawn-loop.js index 2b63dea67..b17452dc8 100644 --- a/test/mjsunit/test-process-spawn-loop.js +++ b/test/mjsunit/test-process-spawn-loop.js @@ -4,15 +4,21 @@ var N = 40; var finished = false; function spawn (i) { - var child = node.createChildProcess('python -c "print 500 * 1024 * \'C\'"'); + var child = node.createChildProcess( 'python' + , ['-c', 'print 500 * 1024 * "C"'] + ); var output = ""; child.addListener("output", function(chunk) { if (chunk) output += chunk; }); + child.addListener("error", function(chunk) { + if (chunk) error(chunk) + }); + child.addListener("exit", function () { - //puts(output); + puts(output); if (i < N) spawn(i+1); else |