Commit 807e5aeb authored by Pavel Vainerman's avatar Pavel Vainerman

(ComPort): /coverity scan/

[fixed] CID 22672 (#2 of 2): Unchecked return value from library (CHECKED_RETURN)
parent 417e0a37
......@@ -246,13 +246,23 @@ unsigned char ComPort::m_receiveByte( bool wait )
// Перенести в receiveBlock (определяется через timeout == 0)
void ComPort::setBlocking(bool blocking)
{
if(blocking)
if( blocking )
{
fcntl(fd, F_SETFL, 0);
if( fcntl(fd, F_SETFL, 0) == -1 )
{
string str = "setBlocking: err: ";
str += strerror(errno);
throw UniSetTypes::SystemError(str.c_str());
}
}
else
{
fcntl(fd, F_SETFL, O_NONBLOCK);
if( fcntl(fd, F_SETFL, O_NONBLOCK) == -1 )
{
string str = "setBlocking: err: ";
str += strerror(errno);
throw UniSetTypes::SystemError(str.c_str());
}
}
}
// --------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment