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>
This commit is contained in:
Tobias Hunger 2019-09-23 14:24:14 +02:00
parent 20b823f5a7
commit ace9c7853c

View File

@ -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()) {