summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2015-11-30 12:03:18 +0100
committerDavid Faure <david.faure@kdab.com>2015-12-29 11:06:13 +0000
commit72b4f0d4743826ee14ec06bf0ada26418f4a69be (patch)
treeaa9f2f5828958c6c6c301e8499d7bef87996b9fa /src
parent9871c3d8bd71ab265d7394495a3a9f0c2963f6ab (diff)
QMimeDatabase: follow symlinks when checking for FIFO etc.
This was documented, but not what the code did. Task-number: QTBUG-48529 Change-Id: I4849778c61dcae13be27c62b24717693c0c07d78 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index c1e17b9fc4..fd11dbc787 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -354,9 +354,10 @@ QMimeType QMimeDatabase::mimeTypeForFile(const QFileInfo &fileInfo, MatchMode mo
#ifdef Q_OS_UNIX
// Cannot access statBuf.st_mode from the filesystem engine, so we have to stat again.
+ // In addition we want to follow symlinks.
const QByteArray nativeFilePath = QFile::encodeName(file.fileName());
QT_STATBUF statBuffer;
- if (QT_LSTAT(nativeFilePath.constData(), &statBuffer) == 0) {
+ if (QT_STAT(nativeFilePath.constData(), &statBuffer) == 0) {
if (S_ISCHR(statBuffer.st_mode))
return d->mimeTypeForName(QLatin1String("inode/chardevice"));
if (S_ISBLK(statBuffer.st_mode))