mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
correct open in case of error
This commit is contained in:
parent
1738281adf
commit
002d26843e
1 changed files with 3 additions and 1 deletions
|
|
@ -121,7 +121,9 @@ SerialPort.prototype.open = function (callback) {
|
|||
SerialPortBinding.open(this.path, this.options, function (err, fd) {
|
||||
self.fd = fd;
|
||||
if (err) {
|
||||
return self.emit('error', err);
|
||||
self.emit('error', err);
|
||||
if (callback) { callback(err); }
|
||||
return;
|
||||
}
|
||||
if (process.platform !== 'win32') {
|
||||
self.readStream = fs.createReadStream(self.path, { bufferSize: self.options.bufferSize, fd: fd });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue