summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfsfileengine.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-10-16 16:10:47 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-10-21 11:46:07 (GMT)
commitbadfa3435f740ec7120b2ed3367fa2be50382136 (patch)
treebbc42c4e2f12d59f54c6c15101cd4b7707be041c /src/corelib/io/qfsfileengine.cpp
parent512c2284cafb3eb23d06fc5cdc4e424b711a04b7 (diff)
downloadQt-badfa3435f740ec7120b2ed3367fa2be50382136.zip
Qt-badfa3435f740ec7120b2ed3367fa2be50382136.tar.gz
Qt-badfa3435f740ec7120b2ed3367fa2be50382136.tar.bz2
Fixes some issues with large files in 32-bit systems
Reviewed-by: Thiago Macieira
Diffstat (limited to 'src/corelib/io/qfsfileengine.cpp')
-rw-r--r--src/corelib/io/qfsfileengine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 2c5451d..c34f8ad 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -564,6 +564,9 @@ bool QFSFileEnginePrivate::seekFdFh(qint64 pos)
if (lastIOCommand != QFSFileEnginePrivate::IOFlushCommand && !q->flush())
return false;
+ if (pos < 0 || pos != qint64(QT_OFF_T(pos)))
+ return false;
+
if (fh) {
// Buffered stdlib mode.
int ret;
@@ -577,7 +580,7 @@ bool QFSFileEnginePrivate::seekFdFh(qint64 pos)
}
} else {
// Unbuffered stdio mode.
- if (QT_LSEEK(fd, pos, SEEK_SET) == -1) {
+ if (QT_LSEEK(fd, QT_OFF_T(pos), SEEK_SET) == -1) {
qWarning() << "QFile::at: Cannot set file position" << pos;
q->setError(QFile::PositionError, qt_error_string(errno));
return false;