Need to take ownership of the serial port descriptor once it has been

successfully initialised.
This commit is contained in:
chris_kohlhoff 2008-06-09 12:05:59 +00:00
parent 95b4b58dca
commit dd79f69ceb

View File

@ -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;
}