diff options
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 7 | ||||
-rw-r--r-- | src/serialport/qserialport_win.cpp | 15 |
2 files changed, 2 insertions, 20 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index 11ab16f..d555805 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -337,12 +337,7 @@ bool QSerialPortPrivate::setRequestToSend(bool set) bool QSerialPortPrivate::flush() { - return completeAsyncWrite() -#ifndef Q_OS_ANDROID - && (::tcdrain(descriptor) != -1); -#else - && (::ioctl(descriptor, TCSBRK, 1) != -1); -#endif + return completeAsyncWrite(); } bool QSerialPortPrivate::clear(QSerialPort::Directions directions) diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp index eccaca9..19f35b7 100644 --- a/src/serialport/qserialport_win.cpp +++ b/src/serialport/qserialport_win.cpp @@ -259,20 +259,7 @@ bool QSerialPortPrivate::setRequestToSend(bool set) bool QSerialPortPrivate::flush() { - Q_Q(QSerialPort); - - bool returnValue = true; - - if (!startAsyncWrite()) - returnValue = false; - - if (!::FlushFileBuffers(handle)) { - q->setError(decodeSystemError()); - returnValue = false; - } - - return returnValue; - + return startAsyncWrite(); } bool QSerialPortPrivate::clear(QSerialPort::Directions directions) |