]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/serial.cpp
Add missing get_handle function to Serial
[libs/core.git] / source / io / serial.cpp
index cf2c6952bf3d7e97eb52eb0102f5253549aa03da..b4cfaab4726718bbfaa5f450cd3c1d7e1bcf29eb 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);
 }
 
@@ -120,5 +120,11 @@ unsigned Serial::do_read(char *buf, unsigned size)
        return ret;
 }
 
+const Handle &Serial::get_handle(Mode m)
+{
+       check_access(m);
+       return handle;
+}
+
 } // namespace IO
 } // namespace Msp