Use QT_LSTAT instead of lstat directly
Not all platforms (such as VxWorks) have lstat. Change-Id: If42f0041f9a6d9bec0a355173c88f28f1819bd57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
7127202358
commit
2740b9d668
@ -28,6 +28,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <qplatformdefs.h>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
# include <qt_windows.h>
|
# include <qt_windows.h>
|
||||||
@ -142,8 +143,8 @@ static int posix_helper(const char *dirpath)
|
|||||||
QByteArray ba = dirpath;
|
QByteArray ba = dirpath;
|
||||||
ba += '/';
|
ba += '/';
|
||||||
ba += entry->d_name;
|
ba += entry->d_name;
|
||||||
struct stat st;
|
QT_STATBUF st;
|
||||||
lstat(ba.constData(), &st);
|
QT_LSTAT(ba.constData(), &st);
|
||||||
if (S_ISDIR(st.st_mode))
|
if (S_ISDIR(st.st_mode))
|
||||||
count += posix_helper(ba.constData());
|
count += posix_helper(ba.constData());
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,7 @@
|
|||||||
#include <QtCore/qset.h>
|
#include <QtCore/qset.h>
|
||||||
#include <QtCore/qstack.h>
|
#include <QtCore/qstack.h>
|
||||||
#include <QtCore/qvariant.h>
|
#include <QtCore/qvariant.h>
|
||||||
|
#include <qplatformdefs.h>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
@ -343,8 +344,8 @@ bool QFileSystemIteratorPrivate::advanceHelper()
|
|||||||
QByteArray ba = m_dirPaths.top();
|
QByteArray ba = m_dirPaths.top();
|
||||||
ba += '/';
|
ba += '/';
|
||||||
ba += name;
|
ba += name;
|
||||||
struct stat st;
|
QT_STATBUF st;
|
||||||
lstat(ba.constData(), &st);
|
QT_LSTAT(ba.constData(), &st);
|
||||||
|
|
||||||
if (S_ISDIR(st.st_mode)) {
|
if (S_ISDIR(st.st_mode)) {
|
||||||
pushSubDirectory(ba);
|
pushSubDirectory(ba);
|
||||||
|
Loading…
Reference in New Issue
Block a user