diff --git a/Makefile.am b/Makefile.am index aeec36e..ca44f8d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # Tell automake to put the object file for monitord/apple.c in dir monitord/ -AUTOMAKE_OPTIONS := subdir-objects +AUTOMAKE_OPTIONS = subdir-objects ACLOCAL_AMFLAGS = -I m4 # The installable executable. diff --git a/configure.ac b/configure.ac index a9218e5..72b52ec 100644 --- a/configure.ac +++ b/configure.ac @@ -2,6 +2,7 @@ AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AM_PROG_AR AC_PROG_CC AC_PROG_CXX diff --git a/monitord/SocketServer.cpp b/monitord/SocketServer.cpp index f26fd5e..54a014e 100644 --- a/monitord/SocketServer.cpp +++ b/monitord/SocketServer.cpp @@ -75,15 +75,15 @@ if (lua_pcall(L, 0, 0, 0)) { - LOG_ERROR("LUA test fehlgeschlagen" << endl ) + FILE_LOG(logERROR) << "LUA test fehlgeschlagen" << endl ; } m_bUseLUAScript=true ; - LOG_INFO("Successfully loaded LUA filter: " << FilterFileName ) + FILE_LOG(logINFO) << "Successfully loaded LUA filter: " << FilterFileName ; } catch (const std::string &e) { - LOG_ERROR("Error loading lua script: " << e) + FILE_LOG(logERROR) << "Error loading lua script: " << e; } #endif @@ -268,7 +268,7 @@ socklen_t sin_size = sizeof (sockaddr_in); int fd = accept(m_sock,(sockaddr*) &socketThread[useSocket]->m_client,&sin_size); - LOG_INFO("new connection from " << inet_ntoa(socketThread[useSocket]->m_client.sin_addr) ) + FILE_LOG(logINFO) << "new connection from " << inet_ntoa(socketThread[useSocket]->m_client.sin_addr) ; // Thread mit dem oben angenommenen Socket starten socketThread[useSocket]->setFD(fd) ; @@ -281,16 +281,16 @@ closesocket( m_sock); // Alle Clients beenden - LOG_INFO("Beende alle Clients" ) + FILE_LOG(logINFO) << "Beende alle Clients" ; for (int i=0;iIsRunning()) { socketThread[i]->closeSocket() ; - LOG_INFO(i << ": closesocket done" ) + FILE_LOG(logINFO) << i << ": closesocket done" ; socketThread[i]->Kill() ; - LOG_INFO(i << ": kill done" ) + FILE_LOG(logINFO) << i << ": kill done" ; } } @@ -435,19 +435,19 @@ /* do the call (2 arguments, 1 result) */ if (lua_pcall(L, 0, LUA_MULTRET, 0) != 0) { - LOG_ERROR("Fehler beim Aufruf lua dispatcher script:" << lua_tostring(L, -1)) + FILE_LOG(logERROR) << "Fehler beim Aufruf lua dispatcher script:" << lua_tostring(L, -1); //error(L, "error running function `f': %s", // lua_tostring(L, -1)); } /* retrieve result */ if (!lua_isnumber(L, -1)) { - LOG_ERROR("nicht-numerische Antwort vom lua dispatcher script" ) + FILE_LOG(logERROR) << "nicht-numerische Antwort vom lua dispatcher script" ; //error(L, "function `f' must return a number"); } z = lua_tonumber(L, -1); lua_pop(L, 1); /* pop returned value */ - LOG_DEBUG("lua Result (global dispatcher)" << z) + FILE_LOG(logDEBUG1) << "lua Result (global dispatcher)" << z ; if (z==1) m_bSkipDispatching=true ; } @@ -548,7 +548,7 @@ createLock() ; createSocket() ; - LOG_INFO("SocketThreads exits" ) + FILE_LOG(logINFO) << "SocketThreads exits" ; releaseLock() ; return NULL; @@ -617,7 +617,7 @@ unsigned int len=send( m_fd, something.c_str(), something.length(), 0); if (len!=something.length()) { - LOG_ERROR("error sending date to client. thread exiting" ) + FILE_LOG(logERROR) << "error sending date to client. thread exiting" ; doLogout() ; } } @@ -627,7 +627,7 @@ unsigned int len = send( m_fd, something, strlen(something), 0); if (len!=strlen(something)) { - LOG_ERROR("error sending date to client. thread exiting" ) + FILE_LOG(logERROR) << "error sending date to client. thread exiting" ; doLogout() ; } } @@ -674,7 +674,7 @@ // Gültige IP Adresse, die sich nicht anmelden muss ? if (m_MonitorConfiguration->IsValidLogin("","",this->m_sClientIP)) { - LOG_INFO("login authentication (ip allowed): " << m_sClientIP ) + FILE_LOG(logINFO) << "login authentication (ip allowed): " << m_sClientIP ; this->m_authenticated=true ; } @@ -718,20 +718,20 @@ if (FD_ISSET(m_fd,&fdset)>0) // Socket ereignis ? { - LOG_DEBUG("Socket reports read event") + FILE_LOG(logDEBUG) << "Socket reports read event" ; result=1 ; } if (FD_ISSET(m_fd,&fdset_write)>0) // Problem ? { - LOG_DEBUG("Socket reports write event") + FILE_LOG(logDEBUG) << "Socket reports write event" ; result=0 ; //m_exitThread=true ; } if (FD_ISSET(m_fd,&fdset_exceptions)>0) // Problem ? { - LOG_DEBUG("Socket reports exception event") + FILE_LOG(logDEBUG) << "Socket reports exception event" ; result=0 ; m_exitThread=true ; } @@ -744,7 +744,7 @@ gelesen=recv (m_fd, buffer, RECV_BUFFER-1, 0) ; if (gelesen<=0) // Nix am Port, aber doch Port Event ? { - LOG_INFO("recv()<=0 => socketthread exiting" ) + FILE_LOG(logINFO) << "recv()<=0 => socketthread exiting" ; m_exitThread=true ; } buffer[gelesen]='\0'; @@ -848,7 +848,7 @@ MonitorSocketsManager::MonitorSocketsManager() { - LOG_DEBUG("SocketManager erstellt") + FILE_LOG(logDEBUG) << "SocketManager erstellt" ; if ( memLockCreate( 12347, & m_MemLock) < 0) { ThrowMonitorException("SocketsManager: memLockCreate failed") ; diff --git a/monitord/plugins/mpluginAudio.cpp b/monitord/plugins/mpluginAudio.cpp index d76ee35..a7d6f10 100644 --- a/monitord/plugins/mpluginAudio.cpp +++ b/monitord/plugins/mpluginAudio.cpp @@ -1,4 +1,5 @@ #include "mpluginAudio.h" +#include using namespace std ; @@ -17,7 +18,7 @@ pMsg->pThread=pClient ; pMsg->message=message ; - while (m_bLockSocketMessages==true) Sleep(3) ; + while (m_bLockSocketMessages==true) sleep(3) ; m_bLockSocketMessages=true ; m_SocketMessages.push_back(pMsg) ; @@ -38,7 +39,7 @@ { bool retVal=false ; - while (m_bLockSocketMessages) Sleep(1) ; + while (m_bLockSocketMessages) sleep(1) ; m_bLockSocketMessages=true ; diff --git a/simpleopt/SimpleGlob.h b/simpleopt/SimpleGlob.h index 0ed1946..7e9f731 100644 --- a/simpleopt/SimpleGlob.h +++ b/simpleopt/SimpleGlob.h @@ -620,7 +620,7 @@ if (!SimpleGlobUtil::strchr(a_pszFileSpec, '*') && !SimpleGlobUtil::strchr(a_pszFileSpec, '?')) { - SG_FileType nType = GetFileTypeS(a_pszFileSpec); + SG_FileType nType = this->GetFileTypeS(a_pszFileSpec); if (nType == SG_FILETYPE_INVALID) { if (m_uiFlags & SG_GLOB_NOCHECK) { return AppendName(a_pszFileSpec, false); @@ -641,7 +641,7 @@ #endif // search for the first match on the file - int rc = FindFirstFileS(a_pszFileSpec, m_uiFlags); + int rc = this->FindFirstFileS(a_pszFileSpec, m_uiFlags); if (rc != SG_SUCCESS) { if (rc == SG_ERR_NOMATCH && (m_uiFlags & SG_GLOB_NOCHECK)) { int ok = AppendName(a_pszFileSpec, false); @@ -654,8 +654,8 @@ int nError, nStartLen = m_nArgsLen; bool bSuccess; do { - nError = AppendName(GetFileNameS((SOCHAR)0), IsDirS((SOCHAR)0)); - bSuccess = FindNextFileS((SOCHAR)0); + nError = AppendName(this->GetFileNameS((SOCHAR)0), this->IsDirS((SOCHAR)0)); + bSuccess = this->FindNextFileS((SOCHAR)0); } while (nError == SG_SUCCESS && bSuccess); SimpleGlobBase::FindDone();