mirror of
https://github.com/glest/glest-source.git
synced 2025-08-28 10:19:55 +02:00
added #define for Linux Distros that don't support S_IREAD
This commit is contained in:
@@ -229,9 +229,17 @@ void SystemFlags::handleDebug(DebugType type, const char *fmt, ...) {
|
|||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
//SystemFlags::lockFile = open(lockfile.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR|S_IWUSR);
|
//SystemFlags::lockFile = open(lockfile.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR|S_IWUSR);
|
||||||
|
#ifdef S_IREAD
|
||||||
SystemFlags::lockFile = open(lockfile.c_str(), O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
|
SystemFlags::lockFile = open(lockfile.c_str(), O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
|
||||||
#else
|
#else
|
||||||
|
SystemFlags::lockFile = open(lockfile.c_str(), O_WRONLY | O_CREAT);
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#ifdef S_IREAD
|
||||||
SystemFlags::lockFile = _open(lockfile.c_str(), O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
|
SystemFlags::lockFile = _open(lockfile.c_str(), O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
|
||||||
|
#else
|
||||||
|
SystemFlags::lockFile = _open(lockfile.c_str(), O_WRONLY | O_CREAT);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (SystemFlags::lockFile < 0 || acquire_file_lock(SystemFlags::lockFile) == false) {
|
if (SystemFlags::lockFile < 0 || acquire_file_lock(SystemFlags::lockFile) == false) {
|
||||||
string newlockfile = lockfile;
|
string newlockfile = lockfile;
|
||||||
@@ -240,9 +248,18 @@ void SystemFlags::handleDebug(DebugType type, const char *fmt, ...) {
|
|||||||
newlockfile = lockfile + intToStr(idx);
|
newlockfile = lockfile + intToStr(idx);
|
||||||
//SystemFlags::lockFile = open(newlockfile.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR|S_IWUSR);
|
//SystemFlags::lockFile = open(newlockfile.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR|S_IWUSR);
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
#ifdef S_IREAD
|
||||||
SystemFlags::lockFile = open(newlockfile.c_str(), O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
|
SystemFlags::lockFile = open(newlockfile.c_str(), O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
|
||||||
#else
|
#else
|
||||||
|
SystemFlags::lockFile = open(newlockfile.c_str(), O_WRONLY | O_CREAT);
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#ifdef S_IREAD
|
||||||
SystemFlags::lockFile = _open(newlockfile.c_str(), O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
|
SystemFlags::lockFile = _open(newlockfile.c_str(), O_WRONLY | O_CREAT, S_IREAD | S_IWRITE);
|
||||||
|
#else
|
||||||
|
SystemFlags::lockFile = _open(newlockfile.c_str(), O_WRONLY | O_CREAT);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if(SystemFlags::lockFile >= 0 && acquire_file_lock(SystemFlags::lockFile) == true) {
|
if(SystemFlags::lockFile >= 0 && acquire_file_lock(SystemFlags::lockFile) == true) {
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user