Make setNativeLocks() non-fatal on OS X.

This commit is contained in:
Felix Geyer 2015-07-21 23:12:20 +02:00
parent ceeb72a277
commit af3d896bdf

View File

@ -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;
}