diff options
| author | Tobias Hunger <tobias.hunger@qt.io> | 2019-09-23 14:24:14 +0200 |
|---|---|---|
| committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-10-01 12:49:13 +0200 |
| commit | ace9c7853c9f448953ccb487d95a1a76338c1b9d (patch) | |
| tree | f59da57786c051a373ae5e13f6c13d9cef976766 /src/corelib/io/qresource.cpp | |
| parent | 20b823f5a7058be42dc8a507e6a828ed3e55d37f (diff) | |
Simplify code guarded by QT_USE_MMAP
QT_USE_MMAP is true only on systems with a defined Q_OS_UNIX,
so there is no need to have code for windows in a section guarded
by QT_USE_MMAP.
Change-Id: I33d4ad596cc96f8f2e41374742fd5ec15b9e91a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qresource.cpp')
| -rw-r--r-- | src/corelib/io/qresource.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 22c22ce7115..86d361b06a9 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -1109,14 +1109,8 @@ bool QDynamicFileResourceRoot::registerSelf(const QString &f) uchar *data = nullptr; qsizetype data_len = 0; -#ifdef QT_USE_MMAP - int fd = QT_OPEN(QFile::encodeName(f), O_RDONLY, -#if defined(Q_OS_WIN) - _S_IREAD | _S_IWRITE -#else - 0666 -#endif - ); +#if defined(QT_USE_MMAP) + int fd = QT_OPEN(QFile::encodeName(f), O_RDONLY, 0666); if (fd >= 0) { QT_STATBUF st; if (!QT_FSTAT(fd, &st) && st.st_size <= std::numeric_limits<qsizetype>::max()) { |
