X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Fserial.cpp;h=2b3458a3eb0ea293563a522f6519ef8467ed76dd;hp=cf2c6952bf3d7e97eb52eb0102f5253549aa03da;hb=edeb93fa4182984422f70c453ced8ad3acabe1d0;hpb=bd892a8afd93f849aec21706a009f69a5868b34d diff --git a/source/io/serial.cpp b/source/io/serial.cpp index cf2c695..2b3458a 100644 --- a/source/io/serial.cpp +++ b/source/io/serial.cpp @@ -42,7 +42,7 @@ void Serial::close() void Serial::set_block(bool b) { - mode = b?(mode&~M_NONBLOCK):(mode|M_NONBLOCK); + adjust_mode(mode, M_NONBLOCK, !b); sys_set_blocking(handle, b); }