From f5c293b5ed681ec8d058d81bb1e1e3169c9454b7 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 8 Mar 2013 08:29:36 -0800 Subject: [PATCH] test: Use copy instead of symlink in child-process-fork-exec-path --- test/simple/test-child-process-fork-exec-path.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/simple/test-child-process-fork-exec-path.js b/test/simple/test-child-process-fork-exec-path.js index 36ce11f..51370d7 100755 --- a/test/simple/test-child-process-fork-exec-path.js +++ b/test/simple/test-child-process-fork-exec-path.js @@ -26,32 +26,33 @@ var path = require('path'); var common = require('../common'); var msg = {test: 'this'}; var nodePath = process.execPath; -var symlinkPath = path.join(common.tmpDir, 'node-symlink'); +var copyPath = path.join(common.tmpDir, 'node-copy.exe'); if (process.env.FORK) { assert(process.send); - assert.equal(process.argv[0], symlinkPath); + assert.equal(process.argv[0], copyPath); process.send(msg); process.exit(); } else { try { - fs.unlinkSync(symlinkPath); + fs.unlinkSync(copyPath); } catch (e) { if (e.code !== 'ENOENT') throw e; } - fs.symlinkSync(nodePath, symlinkPath); + fs.writeFileSync(copyPath, fs.readFileSync(nodePath)); + fs.chmodSync(copyPath, '0755'); var child = require('child_process').fork(__filename, { - execPath: symlinkPath, + execPath: copyPath, env: { FORK: 'true' } }); child.on('message', common.mustCall(function(recv) { assert.deepEqual(msg, recv); })); child.on('exit', common.mustCall(function(code) { - fs.unlinkSync(symlinkPath); + fs.unlinkSync(copyPath); assert.equal(code, 0); })); } -- 2.7.4