Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
killagu committed May 11, 2023
1 parent 8d207e0 commit 3726f80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/internal/fs/sync_write_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ ObjectSetPrototypeOf(SyncWriteStream, Writable);
SyncWriteStream.prototype._write = function(chunk, encoding, cb) {
try {
writeSync(this.fd, chunk, 0, chunk.length);
cb();
} catch (e) {
cb(e);
return true;
}
cb();
return true;
};

Expand Down
3 changes: 1 addition & 2 deletions test/parallel/test-internal-fs-syncwritestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ const filename = path.join(tmpdir.path, 'sync-write-stream.txt');
const stream = new SyncWriteStream(fd);

assert.strictEqual(stream.fd, fd);
stream.on('error', common.mustCall());
stream._write({}, common.mustCall((err) => {
stream._write({}, null, common.mustCall((err) => {
assert(err);
}));
}

0 comments on commit 3726f80

Please sign in to comment.