Skip to content

Commit

Permalink
fix: writing issue on Linux (#1908)
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob authored and reconbot committed Aug 14, 2019
1 parent 3d34d0f commit a7d1937
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/bindings/lib/unix-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ module.exports = async function unixWrite(buffer, offset) {
throw new Error('Port is not open')
}
try {
const bytesWritten = await writeAsync(this.fd, buffer, offset, bytesToWrite)
const { bytesWritten } = await writeAsync(this.fd, buffer, offset, bytesToWrite)
logger('write returned: wrote', bytesWritten, 'bytes')
if (bytesWritten + offset < buffer.length) {
if (!this.isOpen) {
throw new Error('Port is not open')
}
return resolve(unixWrite.call(this, buffer, bytesWritten + offset))
return unixWrite.call(this, buffer, bytesWritten + offset)
}

logger('Finished writing', bytesWritten + offset, 'bytes')
Expand Down

0 comments on commit a7d1937

Please sign in to comment.