summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKijam Lopez <kijamve@gmail.com>2014-04-15 03:46:15 -0430
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-23 10:44:11 +0200
commitfd58ceecf8a61e44392c73ec5bbdd276fe0ddce8 (patch)
tree6eeb719ea5ed9351bccc57d90a78085cf5597b35
parent0a48b67b9b79edebaf137f34dabf9a53295ab293 (diff)
downloadqtserialport-fd58ceecf8a61e44392c73ec5bbdd276fe0ddce8.tar.gz
Fix the flush regression on Unix
Currently, flushing is not flushing the buffer to the device because it is calling the wrong function. Before flush() is invoked startAsyncWrite, but this did not flush the buffer when it was not empty. The only possible way to fix this is by invoking the function completeAsyncWrite, it first checks for pending information in the buffer for sending and then invokes startAsyncWrite if necessary. The following change caused the regression: 21f5049 Test Environment: Qt 5.3.0-beta1 and Qt 4.8.2. S.O.: 3.12.6-2kali1 i686 GNU/Linux. Fiscal Machine: SRP350 Bixolon. USB Adapter Serial Port: CH341 Task-number: QTBUG-38339 Change-Id: I5159b48f073d537a396b65484fcc2c3d37e4908c Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
-rw-r--r--src/serialport/qserialport_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index 0f999bb..007a775 100644
--- a/src/serialport/qserialport_unix.cpp
+++ b/src/serialport/qserialport_unix.cpp
@@ -406,7 +406,7 @@ bool QSerialPortPrivate::setRequestToSend(bool set)
bool QSerialPortPrivate::flush()
{
- return startAsyncWrite()
+ return completeAsyncWrite()
#ifndef Q_OS_ANDROID
&& (::tcdrain(descriptor) != -1);
#else