summaryrefslogtreecommitdiffstats
path: root/src/serialport/qserialport_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/serialport/qserialport_win.cpp')
-rw-r--r--src/serialport/qserialport_win.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp
index ffc8aa47..be4530ad 100644
--- a/src/serialport/qserialport_win.cpp
+++ b/src/serialport/qserialport_win.cpp
@@ -313,7 +313,20 @@ bool QSerialPortPrivate::setRequestToSend(bool set)
bool QSerialPortPrivate::flush()
{
- return startAsyncWrite() && ::FlushFileBuffers(handle);
+ Q_Q(QSerialPort);
+
+ bool returnValue = true;
+
+ if (!startAsyncWrite())
+ returnValue = false;
+
+ if (!::FlushFileBuffers(handle)) {
+ q->setError(decodeSystemError());
+ returnValue = false;
+ }
+
+ return returnValue;
+
}
bool QSerialPortPrivate::clear(QSerialPort::Directions directions)