Skip to content

Commit

Permalink
use .destroy to close fs streams
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Jan 22, 2018
1 parent 8a49159 commit 7b53f15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ eos(ws, function(err) {
assert(this === ws);
if (!expected) process.exit(0);
});
ws.close();
ws.destroy();

var rs1 = fs.createReadStream('/dev/random');
eos(rs1, function(err) {
Expand All @@ -22,7 +22,7 @@ eos(rs1, function(err) {
assert(this === rs1);
if (!expected) process.exit(0);
});
rs1.close();
rs1.destroy();

var rs2 = fs.createReadStream(__filename);
eos(rs2, function(err) {
Expand Down

0 comments on commit 7b53f15

Please sign in to comment.