summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-11-19 16:15:03 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-11-19 16:40:53 (GMT)
commit095c92f03e0c01b878eaa0cd1b7844171ce9241f (patch)
tree65ba06ca2e2aa7260ab3adfa9a7c88672b88bd92
parent45e49fc7a325855c6eafa83b85f5ddfdf793c118 (diff)
downloadQt-095c92f03e0c01b878eaa0cd1b7844171ce9241f.zip
Qt-095c92f03e0c01b878eaa0cd1b7844171ce9241f.tar.gz
Qt-095c92f03e0c01b878eaa0cd1b7844171ce9241f.tar.bz2
Revert check for file size to a warning in QFile::map
The check, introduced in c66de8a19b558e14097c402480eeabf0b5ec2351, changes behavior and it is not clear whether we should prevent mmaping beyond EOF. FWIW, python prevents it. Leaving a warning in there for now so as not to break applications that depend on the feature. Task-number: QTBUG-6008 Reviewed-by: Thiago Macieira
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 05e6fab..35737b3 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -1254,7 +1254,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
// undefined behavior. Otherwise, let mmap have its say.
if (doStat()
&& (QT_OFF_T(size) > st.st_size - QT_OFF_T(offset)))
- return 0;
+ qWarning("QFSFileEngine::map: Mapping a file beyond its size is not portable");
int access = 0;
if (openMode & QIODevice::ReadOnly) access |= PROT_READ;