From fa26495293e0488f63246b2188436a01cb7332d0 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 22 Feb 2014 10:51:55 -0800 Subject: [PATCH] QSerialPort emitting constant errors on Unix environment This fix was pulled across from current QSerialPort codebase. I looked into pulling across newer version of full QSerialPort. While doing that I discovered that the version we are using has already been hacked to work with us. It was fairly involved to redo those hacks. So decided to pull individual change across instead since our version is already not clean. When we switch to Qt5 all this will go away. --- libs/serialport/qserialport_unix.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/serialport/qserialport_unix.cpp b/libs/serialport/qserialport_unix.cpp index 2f6c8ccba..92d9f2f4c 100644 --- a/libs/serialport/qserialport_unix.cpp +++ b/libs/serialport/qserialport_unix.cpp @@ -429,7 +429,8 @@ bool QSerialPortPrivate::waitForReadyRead(int msecs) bool timedOut = false; if (!waitForReadOrWrite(&readyToRead, &readyToWrite, true, !writeBuffer.isEmpty(), timeoutValue(msecs, stopWatch.elapsed()), &timedOut)) { - q_ptr->setError(decodeSystemError()); + if (!timedOut) + q_ptr->setError(decodeSystemError()); return false; } @@ -460,7 +461,8 @@ bool QSerialPortPrivate::waitForBytesWritten(int msecs) bool timedOut = false; if (!waitForReadOrWrite(&readyToRead, &readyToWrite, true, !writeBuffer.isEmpty(), timeoutValue(msecs, stopWatch.elapsed()), &timedOut)) { - q_ptr->setError(decodeSystemError()); + if (!timedOut) + q_ptr->setError(decodeSystemError()); return false; } -- 2.22.0