From 811118f68df4171268f65fa6fc075d6c7633f1e4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 24 Oct 2016 14:58:11 +0200 Subject: qmake: make IoUtils::fileType() return more expressive result it now does not see anything except regular files and directories any more. that's not expected to be a problem, given the function's scope. Change-Id: I53063ad8cacb3afe5cc1baf6d6d5feba3465e74f Reviewed-by: Tobias Hunger (cherry picked from qtcreator/cf82f210804151452fce3cddb3cb2793dab976eb) Reviewed-by: Joerg Bornemann --- qmake/library/ioutils.cpp | 2 +- qmake/library/qmakevfs.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index cb4aa5e74d..4aa3282e3b 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -60,7 +60,7 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName) struct ::stat st; if (::stat(fileName.toLocal8Bit().constData(), &st)) return FileNotFound; - return S_ISDIR(st.st_mode) ? FileIsDir : FileIsRegular; + return S_ISDIR(st.st_mode) ? FileIsDir : S_ISREG(st.st_mode) ? FileIsRegular : FileNotFound; #endif } diff --git a/qmake/library/qmakevfs.cpp b/qmake/library/qmakevfs.cpp index 7631723b1b..c40f49c4ad 100644 --- a/qmake/library/qmakevfs.cpp +++ b/qmake/library/qmakevfs.cpp @@ -155,7 +155,7 @@ bool QMakeVfs::exists(const QString &fn) if (it != m_files.constEnd()) return it->constData() != m_magicMissing.constData(); #endif - bool ex = IoUtils::exists(fn); + bool ex = IoUtils::fileType(fn) == IoUtils::FileIsRegular; #ifndef PROEVALUATOR_FULL m_files[fn] = ex ? m_magicExisting : m_magicMissing; #endif -- cgit v1.2.3