summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemiterator_unix.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-04 11:39:15 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-04 11:39:15 +0100
commite918605f4238841596a1723a0a8592ec152dc723 (patch)
tree1c00298abfd5dbb47cb4125b22f37f14fcdbe4d8 /src/corelib/io/qfilesystemiterator_unix.cpp
parent1a1a0e31590a5a7f360a86de5c34a2aec8e17157 (diff)
parent15df60239d2dd3b0f0844e3ec8c91300fb7a4b67 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/corelib/json/qjsonparser.cpp src/gui/opengl/qopengl.cpp Change-Id: Ib4d3208398399691839e6c6eaeb9006f99e3a62b
Diffstat (limited to 'src/corelib/io/qfilesystemiterator_unix.cpp')
-rw-r--r--src/corelib/io/qfilesystemiterator_unix.cpp38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/corelib/io/qfilesystemiterator_unix.cpp b/src/corelib/io/qfilesystemiterator_unix.cpp
index d7b21fac32..0d1438f137 100644
--- a/src/corelib/io/qfilesystemiterator_unix.cpp
+++ b/src/corelib/io/qfilesystemiterator_unix.cpp
@@ -52,9 +52,6 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
: nativePath(entry.nativeFilePath())
, dir(0)
, dirEntry(0)
-#if defined(Q_OS_QNX) && defined(__EXT_QNX__READDIR_R)
- , direntSize(0)
-#endif
, lastError(0)
{
Q_UNUSED(filters)
@@ -64,32 +61,8 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
if ((dir = QT_OPENDIR(nativePath.constData())) == 0) {
lastError = errno;
} else {
-
if (!nativePath.endsWith('/'))
nativePath.append('/');
-
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) || defined(QT_EXT_QNX_READDIR_R)
- // ### Race condition; we should use fpathconf and dirfd().
- size_t maxPathName = ::pathconf(nativePath.constData(), _PC_NAME_MAX);
- if (maxPathName == size_t(-1))
- maxPathName = FILENAME_MAX;
- maxPathName += sizeof(QT_DIRENT) + 1;
-
- QT_DIRENT *p = reinterpret_cast<QT_DIRENT*>(::malloc(maxPathName));
- Q_CHECK_PTR(p);
-
- mt_file.reset(p);
-#if defined(QT_EXT_QNX_READDIR_R)
- direntSize = maxPathName;
-
- // Include extra stat information in the readdir() call (d_stat member of
- // dirent_extra_stat). This is used in QFileSystemMetaData::fillFromDirEnt() to
- // avoid extra stat() calls when iterating over directories
- int flags = dircntl(dir, D_GETFLAG) | D_FLAG_STAT | D_FLAG_FILTER;
- if (dircntl(dir, D_SETFLAG, flags) == -1)
- lastError = errno;
-#endif
-#endif
}
}
@@ -104,18 +77,7 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa
if (!dir)
return false;
-#if defined(QT_EXT_QNX_READDIR_R)
- lastError = QT_EXT_QNX_READDIR_R(dir, mt_file.data(), &dirEntry, direntSize);
- if (lastError)
- return false;
-#elif defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
- lastError = QT_READDIR_R(dir, mt_file.data(), &dirEntry);
- if (lastError)
- return false;
-#else
- // ### add local lock to prevent breaking reentrancy
dirEntry = QT_READDIR(dir);
-#endif // _POSIX_THREAD_SAFE_FUNCTIONS
if (dirEntry) {
fileEntry = QFileSystemEntry(nativePath + QByteArray(dirEntry->d_name), QFileSystemEntry::FromNativePath());