mirror of https://github.com/Icinga/icinga2.git
parent
41f620a8f0
commit
4f1c10f529
|
@ -9,7 +9,9 @@ Application::Application(void)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
WSAStartup(MAKEWORD(1, 1), &wsaData);
|
WSAStartup(MAKEWORD(1, 1), &wsaData);
|
||||||
#endif
|
#else /* _WIN32 */
|
||||||
|
lt_dlinit();
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
m_ShuttingDown = false;
|
m_ShuttingDown = false;
|
||||||
m_ConfigHive = new_object<ConfigHive>();
|
m_ConfigHive = new_object<ConfigHive>();
|
||||||
|
@ -20,13 +22,15 @@ Application::~Application(void)
|
||||||
Timer::StopAllTimers();
|
Timer::StopAllTimers();
|
||||||
Socket::CloseAllSockets();
|
Socket::CloseAllSockets();
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
WSACleanup();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (map<string, Component::RefType>::iterator i = m_Components.begin(); i != m_Components.end(); i++) {
|
for (map<string, Component::RefType>::iterator i = m_Components.begin(); i != m_Components.end(); i++) {
|
||||||
i->second->Stop();
|
i->second->Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSACleanup();
|
||||||
|
#else /* _WIN32 */
|
||||||
|
lt_dlexit();
|
||||||
|
#endif /* _WIN32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::RunEventLoop(void)
|
void Application::RunEventLoop(void)
|
||||||
|
@ -247,4 +251,5 @@ void Application::Log(const char *format, ...)
|
||||||
|
|
||||||
// TODO: log to file
|
// TODO: log to file
|
||||||
fprintf(stderr, "%s\n", message);
|
fprintf(stderr, "%s\n", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
base/unix.h
10
base/unix.h
|
@ -40,13 +40,13 @@ typedef lt_dlhandle HMODULE;
|
||||||
inline HMODULE LoadLibrary(const char *filename)
|
inline HMODULE LoadLibrary(const char *filename)
|
||||||
{
|
{
|
||||||
lt_dlhandle handle = 0;
|
lt_dlhandle handle = 0;
|
||||||
lt_dladvise advise;
|
lt_dladvise advise;
|
||||||
|
|
||||||
if (!lt_dladvise_init(&advise) && !lt_dladvise_global(&advise)) {
|
if (!lt_dladvise_init(&advise) && !lt_dladvise_global(&advise)) {
|
||||||
handle = lt_dlopenadvise(filename, advise);
|
handle = lt_dlopenadvise(filename, advise);
|
||||||
}
|
}
|
||||||
|
|
||||||
lt_dladvise_destroy(&advise);
|
lt_dladvise_destroy(&advise);
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,3 +9,5 @@ libconfigfilecomponent_la_SOURCES = \
|
||||||
i2-configfilecomponent.h
|
i2-configfilecomponent.h
|
||||||
|
|
||||||
libconfigfilecomponent_la_CXXFLAGS = -I${top_srcdir}/base -I${top_srcdir}/jsonrpc
|
libconfigfilecomponent_la_CXXFLAGS = -I${top_srcdir}/base -I${top_srcdir}/jsonrpc
|
||||||
|
|
||||||
|
libconfigfilecomponent_la_LDFLAGS = -module -version-info 0:0:0 -no-undefined
|
|
@ -9,3 +9,5 @@ libconfigrpccomponent_la_SOURCES = \
|
||||||
i2-configrpccomponent.h
|
i2-configrpccomponent.h
|
||||||
|
|
||||||
libconfigrpccomponent_la_CXXFLAGS = -I${top_srcdir}/base -I${top_srcdir}/jsonrpc -I${top_srcdir}/icinga
|
libconfigrpccomponent_la_CXXFLAGS = -I${top_srcdir}/base -I${top_srcdir}/jsonrpc -I${top_srcdir}/icinga
|
||||||
|
|
||||||
|
libconfigrpccomponent_la_LDFLAGS = -module -version-info 0:0:0 -no-undefined
|
Loading…
Reference in New Issue