Darwin caused ipc mutex to stop working for non-darwin, non-windows systems. Hopefully fixed

This commit is contained in:
KimLS 2014-04-25 18:45:19 -07:00
parent e047d99a6c
commit 5e81848445

View File

@ -55,17 +55,22 @@ namespace EQEmu {
std::string final_name = name; std::string final_name = name;
final_name += ".lock"; final_name += ".lock";
#ifdef __DARWIN #ifdef __DARWIN
#if __DARWIN_C_LEVEL < 200809L #if __DARWIN_C_LEVEL < 200809L
imp_->fd_ = open(final_name.c_str(), imp_->fd_ = open(final_name.c_str(),
O_RDWR | O_CREAT, O_RDWR | O_CREAT,
S_IRUSR | S_IWUSR); S_IRUSR | S_IWUSR);
#else #else
imp_->fd_ = open(final_name.c_str(), imp_->fd_ = open(final_name.c_str(),
O_RDWR | O_CREAT | O_CLOEXEC, O_RDWR | O_CREAT | O_CLOEXEC,
S_IRUSR | S_IWUSR); S_IRUSR | S_IWUSR);
#endif #endif
#else
imp_->fd_ = open(final_name.c_str(),
O_RDWR | O_CREAT | O_CLOEXEC,
S_IRUSR | S_IWUSR);
#endif #endif
if(imp_->fd_ == -1) { if(imp_->fd_ == -1) {
EQ_EXCEPT("IPC Mutex", "Could not create mutex."); EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
} }