diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-07-07 16:43:32 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-07-10 08:59:07 +0000 |
commit | 56286d8564ec9016f67a7fc82cfe843b11ebed2a (patch) | |
tree | 57e844529e09bf9b43afcebf77051035405f7ce3 | |
parent | 68245a2c800ef52d2ebd921b82c06e0d6ff3c43c (diff) |
Fix build graph locker error message on Windows
Our process name comparison code needs to be case-insensitive on that
platform.
Change-Id: I1be507889e0ea96441ff4bcaa05acce61c1820b7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
-rw-r--r-- | src/lib/corelib/tools/buildgraphlocker.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/corelib/tools/buildgraphlocker.cpp b/src/lib/corelib/tools/buildgraphlocker.cpp index 82b4f0201..e63ad0dd1 100644 --- a/src/lib/corelib/tools/buildgraphlocker.cpp +++ b/src/lib/corelib/tools/buildgraphlocker.cpp @@ -72,6 +72,11 @@ static void tryCreateBuildDirectory(const QString &buildDir, const QString &buil } } +static bool appNamesAreEqual(const QString &app1, const QString &app2) +{ + return QString::compare(app1, app2, HostOsInfo::fileNameCaseSensitivity()) == 0; +} + BuildGraphLocker::BuildGraphLocker(const QString &buildGraphFilePath, const Logger &logger, bool waitIndefinitely, ProgressObserver *observer) : m_lockFile(buildGraphFilePath + QLatin1String(".lock")) @@ -97,7 +102,7 @@ BuildGraphLocker::BuildGraphLocker(const QString &buildGraphFilePath, const Logg QString hostName; QString appName; if (m_lockFile.getLockInfo(&pid, &hostName, &appName)) { - if ((!hasQtBug53392()) || appName == processNameByPid(pid)) { + if ((!hasQtBug53392()) || appNamesAreEqual(appName, processNameByPid(pid))) { throw ErrorInfo(Tr::tr("Cannot lock build graph file '%1': " "Already locked by '%2' (PID %3).") .arg(buildGraphFilePath, appName).arg(pid)); |