diff options
author | Sergio Ahumada <sergio.ahumada@nokia.com> | 2011-08-08 10:40:36 (GMT) |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@nokia.com> | 2011-08-08 10:40:36 (GMT) |
commit | bb070cae0cde7a83d519582e5872908f7eb2b51b (patch) | |
tree | 89bc5b2e8a24418372b7fdb6c3c0778639ece956 /tools/runonphone/symbianutils/trkdevice.cpp | |
parent | 16502c81a92cc4a0c4d8753372b568cdc61f0c53 (diff) | |
parent | 82a18deee74bef3e545bf6426164dbe12548e5d9 (diff) | |
download | Qt-bb070cae0cde7a83d519582e5872908f7eb2b51b.zip Qt-bb070cae0cde7a83d519582e5872908f7eb2b51b.tar.gz Qt-bb070cae0cde7a83d519582e5872908f7eb2b51b.tar.bz2 |
Merge remote-tracking branch 'upstream/4.8'
Diffstat (limited to 'tools/runonphone/symbianutils/trkdevice.cpp')
-rw-r--r-- | tools/runonphone/symbianutils/trkdevice.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/runonphone/symbianutils/trkdevice.cpp b/tools/runonphone/symbianutils/trkdevice.cpp index c6dc0a4..e28e70e 100644 --- a/tools/runonphone/symbianutils/trkdevice.cpp +++ b/tools/runonphone/symbianutils/trkdevice.cpp @@ -694,7 +694,7 @@ public slots: void terminate(); private: - enum Handles { FileHandle, TerminateEventHandle, HandleCount }; + enum Handles { TerminateEventHandle, FileHandle, HandleCount }; inline int tryRead(); @@ -727,7 +727,7 @@ int WinReaderThread::tryRead() const DWORD bytesToRead = qMax(DWORD(1), qMin(comStat.cbInQue, DWORD(BufSize))); // Trigger read DWORD bytesRead = 0; - if (ReadFile(m_context->device, &buffer, bytesToRead, &bytesRead, &m_context->readOverlapped)) { + if (ReadFile(m_context->device, &buffer, bytesToRead, &bytesRead, &m_context->readOverlapped) && bytesRead > 0) { if (bytesRead == 1) { processData(buffer[0]); } else { @@ -736,7 +736,7 @@ int WinReaderThread::tryRead() return 0; } const DWORD readError = GetLastError(); - if (readError != ERROR_IO_PENDING) { + if (readError != ERROR_IO_PENDING && readError != 0) { emit error(QString::fromLatin1("Read error: %1").arg(winErrorMessage(readError))); return -1; } |