Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/tmp.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function _removeFileAsync(fdPath, next) {
};

if (0 <= fdPath[0])
fs.close(fdPath[0], function (err) {
fs.close(fdPath[0], function () {
fs.unlink(fdPath[1], _handler);
});
else fs.unlink(fdPath[1], _handler);
Expand All @@ -390,6 +390,7 @@ function _removeFileAsync(fdPath, next) {
* @private
*/
function _removeFileSync(fdPath) {
var rethrownException = null;
try {
if (0 <= fdPath[0]) fs.closeSync(fdPath[0]);
} catch (e) {
Expand All @@ -401,9 +402,12 @@ function _removeFileSync(fdPath) {
}
catch (e) {
// reraise any unanticipated error
if (!isENOENT(e)) throw e;
if (!isENOENT(e)) rethrownException = e;
}
}
if (rethrownException !== null) {
throw rethrownException;
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ module.exports.assertMode = function assertMode(name, mode) {
// “other” bits then. Ignore execute bit on that platform because it
// doesn’t exist—even for directories.
if (process.platform == 'win32') {
assert.equal(stat.mode & 000600, mode & 000600);
assert.equal(stat.mode & 0o600, mode & 0o600);
} else {
assert.equal(stat.mode & 000777, mode);
assert.equal(stat.mode & 0o777, mode);
}
};

Expand Down
1 change: 1 addition & 0 deletions test/child-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function _doSpawn(commandArgs, cb, signal) {
child.stdin.end();

function _close() {
// prevent race conditions
if (stderrDone && stdoutDone && !done) {
const
stderr = _bufferConcat(stderrBufs).toString(),
Expand Down
1 change: 0 additions & 1 deletion test/dir-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

var
assert = require('assert'),
fs = require('fs'),
path = require('path'),
inbandStandardTests = require('./inband-standard'),
childProcess = require('./child-process').genericChildProcess,
Expand Down
1 change: 0 additions & 1 deletion test/file-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

var
assert = require('assert'),
fs = require('fs'),
inbandStandardTests = require('./inband-standard'),
assertions = require('./assertions'),
childProcess = require('./child-process').genericChildProcess,
Expand Down
2 changes: 1 addition & 1 deletion test/inband-standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// vim: expandtab:ts=2:sw=2

var
assert = require('assert'),
path = require('path'),
assertions = require('./assertions'),
rimraf = require('rimraf'),
Expand Down Expand Up @@ -80,6 +79,7 @@ function inbandStandardTests(testOpts, opts, isFile, beforeHook, sync = false) {
try {
rimraf.sync(this.topic.name);
} catch (_ignored) {
// ignore
}
throw err;
}
Expand Down
3 changes: 1 addition & 2 deletions test/issue121-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const
assertions = require('./assertions'),
childProcess = require('./child-process').childProcess,
os = require('os'),
rimraf = require('rimraf'),
testCases = [
'SIGINT',
'SIGTERM'
Expand All @@ -27,7 +26,7 @@ describe('tmp', function () {
});
});

function issue121Tests(signal, expectExists) {
function issue121Tests(signal) {
return function (done) {
childProcess(this, 'issue121.json', function (err, stderr, stdout) {
if (err) return done(err);
Expand Down
4 changes: 1 addition & 3 deletions test/outband/issue121.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint-disable no-octal */
// vim: expandtab:ts=2:sw=2

const
tmp = require('../../lib/tmp');
const tmp = require('../../lib/tmp');

process.on('SIGTERM', function () {
process.exit(0);
Expand Down
2 changes: 1 addition & 1 deletion test/outband/issue129-sigint.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function () {

// simulate an existing SIGINT listener
process.addListener('SIGINT', function _tmp$sigint_listener() {
self.out('EOK');
self.out('EOK');
});

// now let tmp install its listener safely
Expand Down