diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2013-02-28 23:30:37 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-02 18:47:29 +0100 |
commit | 0d5d7cb9b5bcebec79b2de6acb43da1b05ad82f6 (patch) | |
tree | db40feab2c7185e7cc0f06714a75d0898a7673b4 /src/serialport/serialport.pro | |
parent | feae6e4634e18516e4f64a20d55f98f40a20cd9e (diff) | |
download | qtserialport-0d5d7cb9b5bcebec79b2de6acb43da1b05ad82f6.tar.gz |
*nix: Fix unexpected clear errno when I/O failed
This bug was detected on MacOSX 10.8 & FTDI serial device.
When removing a previously opened device from the system, triggered
readNotifier() and are trying to read() from the device, but call
returns -1 with errno = 6. It is correct behavior.
But then, when called decodeSystemError(), the now value of errno
is zero, so this method incorrect detect error as NoError.
This reset errno is due to the fact that between calls to read() and
decodeSystemError(), there are other system calls that are implemented
within QRingBuffer (e.g. access to memory).
Therefore, must do decodeSystemError() immediately after the failed
I/O calls, so need to move decodeSystemError() near to I/O calls.
Change-Id: Iad7e78247cf81a0a6ed5053ee996728881414558
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Diffstat (limited to 'src/serialport/serialport.pro')
0 files changed, 0 insertions, 0 deletions