Skip to content

Commit 3726f80

Browse files
committed
f
1 parent 8d207e0 commit 3726f80

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/internal/fs/sync_write_stream.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ ObjectSetPrototypeOf(SyncWriteStream, Writable);
2525
SyncWriteStream.prototype._write = function(chunk, encoding, cb) {
2626
try {
2727
writeSync(this.fd, chunk, 0, chunk.length);
28-
cb();
2928
} catch (e) {
3029
cb(e);
30+
return true;
3131
}
32+
cb();
3233
return true;
3334
};
3435

test/parallel/test-internal-fs-syncwritestream.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ const filename = path.join(tmpdir.path, 'sync-write-stream.txt');
8181
const stream = new SyncWriteStream(fd);
8282

8383
assert.strictEqual(stream.fd, fd);
84-
stream.on('error', common.mustCall());
85-
stream._write({}, common.mustCall((err) => {
84+
stream._write({}, null, common.mustCall((err) => {
8685
assert(err);
8786
}));
8887
}

0 commit comments

Comments
 (0)