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 <tobias.hunger@qt.io>
(cherry picked from qtcreator/cf82f210804151452fce3cddb3cb2793dab976eb)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-10-24 14:58:11 +02:00
parent e2de837198
commit 811118f68d
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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