mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Merge pull request #138 from Corysia/master
Changes for intel Mac OSX build
This commit is contained in:
@@ -30,6 +30,10 @@
|
||||
#ifdef FREEBSD //Timothy Whitman - January 7, 2003
|
||||
#define MSG_NOSIGNAL 0
|
||||
#endif
|
||||
#ifdef DARWIN
|
||||
#define MSG_NOSIGNAL SO_NOSIGPIPE // Corysia Taware - Sept. 27, 2013
|
||||
// See http://lists.apple.com/archives/macnetworkprog/2002/Dec/msg00091.html
|
||||
#endif // DARWIN
|
||||
|
||||
#ifdef _WINDOWS
|
||||
InitWinsock winsock;
|
||||
|
||||
@@ -97,8 +97,12 @@ void BaseTCPServer::ListenNewConnections() {
|
||||
from.sin_family = AF_INET;
|
||||
fromlen = sizeof(from);
|
||||
LockMutex lock(&MSock);
|
||||
#ifndef DARWIN // Corysia - On OSX, 0 is a valid fd.
|
||||
if (!sock)
|
||||
return;
|
||||
#else
|
||||
if (sock == -1) return;
|
||||
#endif
|
||||
|
||||
// Check for pending connects
|
||||
#ifdef _WINDOWS
|
||||
|
||||
@@ -55,10 +55,17 @@ namespace EQEmu {
|
||||
std::string final_name = name;
|
||||
final_name += ".lock";
|
||||
|
||||
#ifdef __DARWIN
|
||||
#if __DARWIN_C_LEVEL < 200809L
|
||||
imp_->fd_ = open(final_name.c_str(),
|
||||
O_RDWR | O_CREAT | O_CLOEXEC,
|
||||
O_RDWR | O_CREAT,
|
||||
S_IRUSR | S_IWUSR);
|
||||
|
||||
#else
|
||||
imp_->fd_ = open(final_name.c_str(),
|
||||
O_RDWR | O_CREAT | O_CLOEXEC,
|
||||
S_IRUSR | S_IWUSR);
|
||||
#endif
|
||||
#endif
|
||||
if(imp_->fd_ == -1) {
|
||||
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user