*nix compilation fix (for rev 402)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@405 0a769ca7-a7f5-676a-18bf-c427514a06d6
master
madmaxoft@gmail.com 2012-03-12 19:42:50 +00:00
parent 10c8c75bb7
commit 57659f010e
1 changed files with 6 additions and 4 deletions

View File

@ -38,6 +38,12 @@ cEvent::cEvent(void)
LOGERROR("cEvent: Cannot create event, errno = %i. Aborting server.", errno);
abort();
}
// Unlink the semaphore immediately - it will continue to function but will not pollute the namespace
// We don't store the name, so can't call this in the destructor
if (sem_unlink(EventName.c_str()) != 0)
{
LOGWARN("ERROR: Could not unlink cEvent. (%i)", errno);
}
}
#endif // *nix
}
@ -53,10 +59,6 @@ cEvent::~cEvent()
#else
if (m_bIsNamed)
{
if (sem_unlink(EventName.c_str()) != 0)
{
LOGWARN("ERROR: Could not unlink cEvent. (%i)", errno);
}
if (sem_close(m_Event) != 0)
{
LOGERROR("ERROR: Could not close cEvent. (%i)", errno);