1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

make changes suggested in review

This commit is contained in:
Paul
2017-11-07 00:15:22 -08:00
committed by GitHub
parent 9325fffd9c
commit bf87489da8

View File

@@ -282,10 +282,6 @@ bool platform_lock_single_instance()
log_warning("Cannot open lock file for writing.");
return false;
}
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* don't block when locking */
#define LOCK_UN 8 /* unlock */
struct flock lock;
@@ -294,10 +290,11 @@ bool platform_lock_single_instance()
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
if (fcntl(pidFile, F_SETLK, &lock) == -1) {
if (fcntl(pidFile, F_SETLK, &lock) == -1)
{
if (errno == EWOULDBLOCK) {
log_warning("Another OpenRCT2 session has been found running.");
return false;
return false;
}
log_error("flock returned an uncatched errno: %d", errno);
return false;