Need to take ownership of the serial port descriptor once it has been
successfully initialised.
This commit is contained in:
parent
95b4b58dca
commit
dd79f69ceb
@ -120,6 +120,13 @@ public:
|
||||
return ec;
|
||||
}
|
||||
|
||||
// We're done. Take ownership of the serial port descriptor.
|
||||
if (descriptor_service_.assign(impl, fd, ec))
|
||||
{
|
||||
asio::error_code ignored_ec;
|
||||
descriptor_ops::close(fd, ignored_ec);
|
||||
}
|
||||
|
||||
return ec;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user