Don't check for EINTR after calling QT_READ / QT_WRITE

On Unix, those functions are already #define'd to qt_safe_read and
qt_safe_write, which do the necessary EINTR handling. On Windows, EINTR
cannot happen.

Change-Id: I50c46472c04bd90a0bac51c725cc86311ae905c8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Thiago Macieira 2014-09-19 14:14:58 -07:00
parent 0c32af08a6
commit fa91bb9a02

View File

@ -619,8 +619,7 @@ qint64 QFSFileEnginePrivate::readFdFh(char *data, qint64 len)
#endif #endif
do { do {
result = QT_READ(fd, data + readBytes, size_t(len - readBytes)); result = QT_READ(fd, data + readBytes, size_t(len - readBytes));
} while ((result == -1 && errno == EINTR) } while (result > 0 && (readBytes += result) < len);
|| (result > 0 && (readBytes += result) < len));
eof = !(result == -1); eof = !(result == -1);
} }
@ -737,8 +736,7 @@ qint64 QFSFileEnginePrivate::writeFdFh(const char *data, qint64 len)
#endif #endif
do { do {
result = QT_WRITE(fd, data + writtenBytes, size_t(len - writtenBytes)); result = QT_WRITE(fd, data + writtenBytes, size_t(len - writtenBytes));
} while ((result == -1 && errno == EINTR) } while (result > 0 && (writtenBytes += result) < len);
|| (result > 0 && (writtenBytes += result) < len));
} }
if (len && writtenBytes == 0) { if (len && writtenBytes == 0) {