diff options
author | Laszlo Papp <lpapp@kde.org> | 2014-02-12 13:54:23 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-12 15:07:04 +0100 |
commit | 18de39f7620ba4111f3846d4e8ea67aa5b701940 (patch) | |
tree | a5ea34a51194a165068b5c885b3ac5a59dc8c9ed | |
parent | 65dd36db940bd9b0c1806f66c54bb672b08eb9b8 (diff) | |
download | qtserialport-18de39f7620ba4111f3846d4e8ea67aa5b701940.tar.gz |
Revert the private qtcore_unix related changes because they break the Qt 4 build
Revert "Open file descriptors thread-safely on Unix and don't leak them"
This reverts commit 691212d9e492b12590d5b7f4e2b24921911d4b17.
Revert "Protect against EINTR in Unix non-atomic I/O calls"
This reverts commit a8597cbae47076e33b638c2e593f852c8c0a02d5.
Change-Id: I6d931ae6d3b4bee9be019fdf4a08ecc5a41a2b0f
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
-rw-r--r-- | src/serialport/qserialport_unix.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/serialport/qserialport_unix.cpp b/src/serialport/qserialport_unix.cpp index 84f3109..844ba13 100644 --- a/src/serialport/qserialport_unix.cpp +++ b/src/serialport/qserialport_unix.cpp @@ -59,8 +59,6 @@ #include <QtCore/qsocketnotifier.h> #include <QtCore/qmap.h> -#include <private/qcore_unix_p.h> - QT_BEGIN_NAMESPACE QString serialPortLockFilePath(const QString &portName) @@ -215,7 +213,7 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode) break; } - descriptor = qt_safe_open(systemLocation.toLocal8Bit().constData(), flags); + descriptor = ::open(systemLocation.toLocal8Bit().constData(), flags); if (descriptor == -1) { q->setError(decodeSystemError()); @@ -306,7 +304,7 @@ void QSerialPortPrivate::close() exceptionNotifier = 0; } - if (qt_safe_close(descriptor) == -1) + if (::close(descriptor) == -1) q->setError(decodeSystemError()); if (lockFileScopedPointer->isLocked()) @@ -1078,7 +1076,7 @@ qint64 QSerialPortPrivate::readFromPort(char *data, qint64 maxSize) if (parity != QSerialPort::MarkParity && parity != QSerialPort::SpaceParity) { #endif - bytesRead = qt_safe_read(descriptor, data, maxSize); + bytesRead = ::read(descriptor, data, maxSize); } else {// Perform parity emulation. bytesRead = readPerChar(data, maxSize); } @@ -1090,11 +1088,11 @@ qint64 QSerialPortPrivate::writeToPort(const char *data, qint64 maxSize) { qint64 bytesWritten = 0; #if defined (CMSPAR) - bytesWritten = qt_safe_write(descriptor, data, maxSize); + bytesWritten = ::write(descriptor, data, maxSize); #else if (parity != QSerialPort::MarkParity && parity != QSerialPort::SpaceParity) { - bytesWritten = qt_safe_write(descriptor, data, maxSize); + bytesWritten = ::write(descriptor, data, maxSize); } else {// Perform parity emulation. bytesWritten = writePerChar(data, maxSize); } @@ -1131,7 +1129,7 @@ qint64 QSerialPortPrivate::writePerChar(const char *data, qint64 maxSize) break; } - int r = qt_safe_write(descriptor, data, 1); + int r = ::write(descriptor, data, 1); if (r < 0) return -1; if (r > 0) { @@ -1157,7 +1155,7 @@ qint64 QSerialPortPrivate::readPerChar(char *data, qint64 maxSize) int prefix = 0; while (ret < maxSize) { - qint64 r = qt_safe_read(descriptor, data, 1); + qint64 r = ::read(descriptor, data, 1); if (r < 0) { if (errno == EAGAIN) // It is ok for nonblocking mode. break; |