From af3d896bdf7d2e7c6627f061148310857ab03e41 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Tue, 21 Jul 2015 23:12:20 +0200 Subject: [PATCH] Make setNativeLocks() non-fatal on OS X. --- src/core/qlockfile_unix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/qlockfile_unix.cpp b/src/core/qlockfile_unix.cpp index d716028bd..5b3add3c5 100644 --- a/src/core/qlockfile_unix.cpp +++ b/src/core/qlockfile_unix.cpp @@ -169,7 +169,13 @@ bool QLockFilePrivate::removeStaleLock() const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY, 0644); if (fd < 0) // gone already? return false; +#ifdef Q_OS_MAC + // ugly workaround: ignore setNativeLocks() result on Mac since it's broken there + setNativeLocks(fd); + bool success = (::unlink(lockFileName) == 0); +#else bool success = setNativeLocks(fd) && (::unlink(lockFileName) == 0); +#endif close(fd); return success; }