diff options
author | Liang Qi <liang.qi@qt.io> | 2017-03-28 09:23:03 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-03-28 09:28:31 +0200 |
commit | b48a13fd6843e12b5725aa3ff0d010007e7c43b4 (patch) | |
tree | 316cfe36fc67906efcd92ff806c7c0da56ed4f8e /src/corelib/io/qlockfile.cpp | |
parent | 3398d9d40cb0dae2dc2a1a4f7dc3b4b9cceae903 (diff) | |
parent | 15fe60cfdada84ea519f08e905d59cc3fb6d20cd (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
examples/examples.pro
tests/auto/corelib/tools/qchar/tst_qchar.cpp
tests/auto/other/qaccessibility/accessiblewidgets.h
Change-Id: I426696c40ab57d14dc295b8103152cede79f244c
Diffstat (limited to 'src/corelib/io/qlockfile.cpp')
-rw-r--r-- | src/corelib/io/qlockfile.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/io/qlockfile.cpp b/src/corelib/io/qlockfile.cpp index cb1ff93ad3..48317d07e0 100644 --- a/src/corelib/io/qlockfile.cpp +++ b/src/corelib/io/qlockfile.cpp @@ -44,6 +44,7 @@ #include <QtCore/qthread.h> #include <QtCore/qdeadlinetimer.h> #include <QtCore/qdatetime.h> +#include <QtCore/qfileinfo.h> QT_BEGIN_NAMESPACE @@ -226,6 +227,8 @@ bool QLockFile::tryLock(int timeout) return false; case LockFailedError: if (!d->isLocked && d->isApparentlyStale()) { + if (Q_UNLIKELY(QFileInfo(d->fileName).lastModified() > QDateTime::currentDateTime())) + qInfo("QLockFile: Lock file '%ls' has a modification time in the future", qUtf16Printable(d->fileName)); // Stale lock from another thread/process // Ensure two processes don't remove it at the same time QLockFile rmlock(d->fileName + QLatin1String(".rmlock")); |