summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemiterator_unix.cpp
diff options
context:
space:
mode:
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());