1
0

Small Linux fixes.

This commit is contained in:
madmaxoft 2013-08-20 19:29:29 +02:00
parent 0faa1ee2cb
commit 40cb30b6a5
3 changed files with 4 additions and 3 deletions

View File

@ -147,6 +147,7 @@ bool cIsThread::Wait(void)
int res = pthread_join(m_Handle, NULL); int res = pthread_join(m_Handle, NULL);
m_Handle = NULL; m_Handle = NULL;
LOGD("Thread %s finished", m_ThreadName.c_str()); LOGD("Thread %s finished", m_ThreadName.c_str());
m_HasStarted = false;
return (res == 0); return (res == 0);
#endif // else _WIN32 #endif // else _WIN32
} }

View File

@ -80,7 +80,7 @@ void cListenThread::Stop(void)
super::Wait(); super::Wait();
// Close all the listening sockets: // Close all the listening sockets:
for (cSockets::iterator itr = m_Sockets.begin(), end = m_Sockets.end(); itr != end; ++itr) for (cSockets::iterator itr = m_Sockets.begin() + 1, end = m_Sockets.end(); itr != end; ++itr)
{ {
itr->CloseSocket(); itr->CloseSocket();
} // for itr - m_Sockets[] } // for itr - m_Sockets[]

View File

@ -74,11 +74,11 @@ void cSocket::CloseSocket()
if (shutdown(m_Socket, SHUT_RDWR) != 0)//SD_BOTH); if (shutdown(m_Socket, SHUT_RDWR) != 0)//SD_BOTH);
{ {
LOGWARN("Error on shutting down socket (%s): %s", m_IPString.c_str(), GetLastErrorString().c_str()); LOGWARN("Error on shutting down socket %d (%s): %s", m_Socket, m_IPString.c_str(), GetLastErrorString().c_str());
} }
if (close(m_Socket) != 0) if (close(m_Socket) != 0)
{ {
LOGWARN("Error closing socket (%s): %s", m_IPString.c_str(), GetLastErrorString().c_str()); LOGWARN("Error closing socket %d (%s): %s", m_Socket, m_IPString.c_str(), GetLastErrorString().c_str());
} }
#endif // else _WIN32 #endif // else _WIN32