From: Gunnar Beutner Date: Sun, 1 Apr 2012 13:20:13 +0000 (+0200) Subject: Fixed ltdl initialization. X-Git-Tag: v0.0.1~673 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f1c10f52924245d35a792b70fa4bc5be0a9ac07;p=icinga2 Fixed ltdl initialization. Fixed indentation --- diff --git a/base/application.cpp b/base/application.cpp index 62b3f13e1..cee433e4f 100644 --- a/base/application.cpp +++ b/base/application.cpp @@ -9,7 +9,9 @@ Application::Application(void) #ifdef _WIN32 WSADATA wsaData; WSAStartup(MAKEWORD(1, 1), &wsaData); -#endif +#else /* _WIN32 */ + lt_dlinit(); +#endif /* _WIN32 */ m_ShuttingDown = false; m_ConfigHive = new_object(); @@ -20,13 +22,15 @@ Application::~Application(void) Timer::StopAllTimers(); Socket::CloseAllSockets(); -#ifdef _WIN32 - WSACleanup(); -#endif - for (map::iterator i = m_Components.begin(); i != m_Components.end(); i++) { i->second->Stop(); } + +#ifdef _WIN32 + WSACleanup(); +#else /* _WIN32 */ + lt_dlexit(); +#endif /* _WIN32 */ } void Application::RunEventLoop(void) @@ -247,4 +251,5 @@ void Application::Log(const char *format, ...) // TODO: log to file fprintf(stderr, "%s\n", message); -} \ No newline at end of file +} + diff --git a/base/unix.h b/base/unix.h index 727b7e318..54d4abe97 100644 --- a/base/unix.h +++ b/base/unix.h @@ -40,13 +40,13 @@ typedef lt_dlhandle HMODULE; inline HMODULE LoadLibrary(const char *filename) { lt_dlhandle handle = 0; - lt_dladvise advise; + lt_dladvise advise; - if (!lt_dladvise_init(&advise) && !lt_dladvise_global(&advise)) { - handle = lt_dlopenadvise(filename, advise); - } + if (!lt_dladvise_init(&advise) && !lt_dladvise_global(&advise)) { + handle = lt_dlopenadvise(filename, advise); + } - lt_dladvise_destroy(&advise); + lt_dladvise_destroy(&advise); return handle; } diff --git a/configfilecomponent/Makefile.am b/configfilecomponent/Makefile.am index 9b0e8bedf..84d57ce4b 100644 --- a/configfilecomponent/Makefile.am +++ b/configfilecomponent/Makefile.am @@ -9,3 +9,5 @@ libconfigfilecomponent_la_SOURCES = \ i2-configfilecomponent.h libconfigfilecomponent_la_CXXFLAGS = -I${top_srcdir}/base -I${top_srcdir}/jsonrpc + +libconfigfilecomponent_la_LDFLAGS = -module -version-info 0:0:0 -no-undefined \ No newline at end of file diff --git a/configrpccomponent/Makefile.am b/configrpccomponent/Makefile.am index 35ffe934d..4435dddf9 100644 --- a/configrpccomponent/Makefile.am +++ b/configrpccomponent/Makefile.am @@ -9,3 +9,5 @@ libconfigrpccomponent_la_SOURCES = \ i2-configrpccomponent.h 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 \ No newline at end of file