From e96ad10fd8f1d6badfe8ff7befbd397d5cbfe2b4 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 20 May 2015 19:28:44 +0200 Subject: 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 Reviewed-by: David Faure --- src/corelib/io/qlockfile_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3