diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-01 05:39:01 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-01 05:39:01 (GMT) |
commit | fb7204725ce88f175de6fa986296b42000e692c0 (patch) | |
tree | 4a79bbe0a403f30a950dfe1fddbc7a893851a75e /src | |
parent | 8599a1002a6ed9ab8571d80f7e704b73de853f34 (diff) | |
parent | 4302c8fa7a234f6f4cfc35f572b93a000d199fe3 (diff) | |
download | Qt-fb7204725ce88f175de6fa986296b42000e692c0.zip Qt-fb7204725ce88f175de6fa986296b42000e692c0.tar.gz Qt-fb7204725ce88f175de6fa986296b42000e692c0.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Symbian file system use optimisation for stat and symlinks
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qfsfileengine_unix.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index d2fa744..1331f54 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -668,6 +668,16 @@ bool QFSFileEnginePrivate::doStat() const could_stat = (QT_FSTAT(QT_FILENO(fh), &st) == 0); } else if (fd == -1) { // ### actually covers two cases: d->fh and when the file is not open +#if defined(Q_OS_SYMBIAN) + // Optimisation for Symbian where fileFlags() calls both doStat() and isSymlink(), but rarely on real links. + // When the filename is not a link, lstat will return the same info as stat, but this also removes + // any need for a further call to lstat to check if the file is a link. + need_lstat = false; + could_stat = (QT_LSTAT(nativeFilePath.constData(), &st) == 0); + is_link = could_stat ? S_ISLNK(st.st_mode) : false; + // if it turns out this was a link, we can call stat too. + if (is_link) +#endif could_stat = (QT_STAT(nativeFilePath.constData(), &st) == 0); } else { could_stat = (QT_FSTAT(fd, &st) == 0); |