mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Plugin fixes for FreeBSD.
This commit is contained in:
parent
62d07a3fc4
commit
48c6b934f4
4 changed files with 14 additions and 10 deletions
2
cmake
2
cmake
|
@ -1 +1 @@
|
||||||
Subproject commit d1c44af3a6cc89f3f277a7585f8f87f1d98782eb
|
Subproject commit 6ebf7598f4932cecf0926705f815cb5634be21b9
|
|
@ -387,6 +387,10 @@ else ()
|
||||||
target_link_libraries(bro ${bro_SUBDIRS} ${brodeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
target_link_libraries(bro ${bro_SUBDIRS} ${brodeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if ( NOT "${bro_LINKER_FLAGS}" STREQUAL "" )
|
||||||
|
set_target_properties(bro PROPERTIES LINK_FLAGS "${bro_LINKER_FLAGS}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
install(TARGETS bro DESTINATION bin)
|
install(TARGETS bro DESTINATION bin)
|
||||||
|
|
||||||
set(BRO_EXE bro
|
set(BRO_EXE bro
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
using namespace plugin;
|
using namespace plugin;
|
||||||
|
|
||||||
Plugin* Manager::current_plugin = 0;
|
Plugin* Manager::current_plugin = 0;
|
||||||
string Manager::current_dir;
|
const char* Manager::current_dir = 0;
|
||||||
string Manager::current_sopath;
|
const char* Manager::current_sopath = 0;
|
||||||
|
|
||||||
Manager::Manager()
|
Manager::Manager()
|
||||||
{
|
{
|
||||||
|
@ -199,7 +199,7 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
||||||
const char* path = gl.gl_pathv[i];
|
const char* path = gl.gl_pathv[i];
|
||||||
|
|
||||||
current_plugin = 0;
|
current_plugin = 0;
|
||||||
current_dir = dir;
|
current_dir = dir.c_str();
|
||||||
current_sopath = path;
|
current_sopath = path;
|
||||||
void* hdl = dlopen(path, RTLD_LAZY | RTLD_GLOBAL);
|
void* hdl = dlopen(path, RTLD_LAZY | RTLD_GLOBAL);
|
||||||
|
|
||||||
|
@ -226,8 +226,8 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
|
||||||
reporter->FatalError("inconsistent plugin name: %s vs %s",
|
reporter->FatalError("inconsistent plugin name: %s vs %s",
|
||||||
current_plugin->Name().c_str(), name.c_str());
|
current_plugin->Name().c_str(), name.c_str());
|
||||||
|
|
||||||
current_dir.clear();
|
current_dir = 0;
|
||||||
current_sopath.clear();
|
current_sopath = 0;
|
||||||
current_plugin = 0;
|
current_plugin = 0;
|
||||||
|
|
||||||
DBG_LOG(DBG_PLUGINS, " Loaded %s", path);
|
DBG_LOG(DBG_PLUGINS, " Loaded %s", path);
|
||||||
|
@ -294,9 +294,9 @@ void Manager::RegisterPlugin(Plugin *plugin)
|
||||||
{
|
{
|
||||||
Manager::ActivePluginsInternal()->push_back(plugin);
|
Manager::ActivePluginsInternal()->push_back(plugin);
|
||||||
|
|
||||||
if ( current_dir.size() && current_sopath.size() )
|
if ( current_dir && current_sopath )
|
||||||
// A dynamic plugin, record its location.
|
// A dynamic plugin, record its location.
|
||||||
plugin->SetPluginLocation(current_dir.c_str(), current_sopath.c_str());
|
plugin->SetPluginLocation(current_dir, current_sopath);
|
||||||
|
|
||||||
// Sort plugins by name to make sure we have a deterministic order.
|
// Sort plugins by name to make sure we have a deterministic order.
|
||||||
ActivePluginsInternal()->sort(plugin_cmp);
|
ActivePluginsInternal()->sort(plugin_cmp);
|
||||||
|
|
|
@ -321,8 +321,8 @@ private:
|
||||||
|
|
||||||
// Helpers providing access to current state during dlopen().
|
// Helpers providing access to current state during dlopen().
|
||||||
static Plugin* current_plugin;
|
static Plugin* current_plugin;
|
||||||
static string current_dir;
|
static const char* current_dir;
|
||||||
static string current_sopath;
|
static const char* current_sopath;
|
||||||
|
|
||||||
// Returns a modifiable list of all plugins, both static and dynamic.
|
// Returns a modifiable list of all plugins, both static and dynamic.
|
||||||
// This is a static method so that plugins can register themselves
|
// This is a static method so that plugins can register themselves
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue