]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/serial.cpp
Add a helper function for adjusting mode flags
[libs/core.git] / source / io / serial.cpp
index cf2c6952bf3d7e97eb52eb0102f5253549aa03da..2b3458a3eb0ea293563a522f6519ef8467ed76dd 100644 (file)
@@ -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);
 }