diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2013-02-24 23:24:58 +0000 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2013-02-26 18:27:28 +0100 |
commit | 4108f2de51ba41c5c8740c7e4e1aafe30e61fbd7 (patch) | |
tree | 27b72a011cf1f78d8f0a629ae2f6df9ecad5f0d1 /src | |
parent | 2146431955ea3098efd6f2ffd2654354b3c86513 (diff) | |
download | qtserialport-4108f2de51ba41c5c8740c7e4e1aafe30e61fbd7.tar.gz |
*nix: Added ENXIO errno code to detect ResourceError
In MacOSX, when pull from the system is already opened USB/Serial
converter to returns ENXIO errno code. Seems it is a MacOSX specific (or
BSD specific) feature. So, now we can catch unexpected disappearance the
device from system on MacOSX.
Tested on MacOSX 10.6.8 & PL2303 converter.
Change-Id: I421e6936ca7b971a071ed6970538d01b23c888f0
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index a259fee..d0e31de 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -913,6 +913,11 @@ QSerialPort::SerialPortError QSerialPortPrivate::decodeSystemError() const case EBADF: error = QSerialPort::ResourceError; break; +#ifdef Q_OS_MAC + case ENXIO: + error = QSerialPort::ResourceError; + break; +#endif default: error = QSerialPort::UnknownError; break; |