summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@theqtcompany.com>2015-05-20 19:28:44 +0200
committerAndy Shaw <andy.shaw@theqtcompany.com>2015-05-22 06:02:39 +0000
commite96ad10fd8f1d6badfe8ff7befbd397d5cbfe2b4 (patch)
treede5fbb702c296ddde04818a91695b43669336218 /src
parent20e36879d72f840005a0361368985b72ce4dc6a4 (diff)
Ensure the same behavior on Win as Unix re the host in isApparentlyStale
When the hostname is empty then it is assumed that the lock file is from the same host as the one running the application. Change-Id: Iba8aefc171a209294371dc2022d93ede3035b242 Reviewed-by: Will Wagner <willw@carallon.com> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qlockfile_win.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qlockfile_win.cpp b/src/corelib/io/qlockfile_win.cpp
index 3587c7bffe..21ab8f8fea 100644
--- a/src/corelib/io/qlockfile_win.cpp
+++ b/src/corelib/io/qlockfile_win.cpp
@@ -120,7 +120,7 @@ bool QLockFilePrivate::isApparentlyStale() const
// processes due to sandboxing
#ifndef Q_OS_WINRT
if (getLockInfo(&pid, &hostname, &appname)) {
- if (hostname == QString::fromLocal8Bit(localHostName())) {
+ if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
if (!procHandle)
return true;