summaryrefslogtreecommitdiffstats
path: root/src/serialport/qserialport_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/serialport/qserialport_unix.cpp')
-rw-r--r--src/serialport/qserialport_unix.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp
index 2f6c8ccb..92d9f2f4 100644
--- a/src/serialport/qserialport_unix.cpp
+++ b/src/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;
}