mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Make setNativeLocks() non-fatal on OS X.
This commit is contained in:
parent
ceeb72a277
commit
af3d896bdf
@ -169,7 +169,13 @@ bool QLockFilePrivate::removeStaleLock()
|
|||||||
const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY, 0644);
|
const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY, 0644);
|
||||||
if (fd < 0) // gone already?
|
if (fd < 0) // gone already?
|
||||||
return false;
|
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);
|
bool success = setNativeLocks(fd) && (::unlink(lockFileName) == 0);
|
||||||
|
#endif
|
||||||
close(fd);
|
close(fd);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user