From d1eb6e0edc51a78f3209448e800b25eda50340f2 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Wed, 23 Feb 2011 11:25:43 +0100 Subject: added work-around for bug in gtls, which causes fd leak when using TLS The capability has been added for module to specify that they do not like being unloaded. related bug tracker: http://bugzilla.adiscon.com/show_bug.cgi?id=222 Signed-off-by: Rainer Gerhards --- runtime/modules.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'runtime/modules.h') diff --git a/runtime/modules.h b/runtime/modules.h index df1afbc3..7eff8581 100644 --- a/runtime/modules.h +++ b/runtime/modules.h @@ -75,12 +75,26 @@ typedef enum eModLinkType_ { eMOD_LINK_ALL /* special: all linkage types, e.g. for unload */ } eModLinkType_t; +/* remember which shared libs we dlopen()-ed */ +struct dlhandle_s { + uchar szName[PATH_MAX]; + void *pModHdlr; + struct dlhandle_s *next; +}; + +/* should this module be kept linked? */ +typedef enum eModKeepType_ { + eMOD_NOKEEP, + eMOD_KEEP +} eModKeepType_t; + struct modInfo_s { struct modInfo_s *pPrev; /* support for creating a double linked module list */ struct modInfo_s *pNext; /* support for creating a linked module list */ int iIFVers; /* Interface version of module */ eModType_t eType; /* type of this module */ eModLinkType_t eLinkType; + eModKeepType_t eKeepType; /* keep the module dynamically linked on unload */ uchar* pszName; /* printable module name, e.g. for dbgprintf */ unsigned uRefCnt; /* reference count for this module; 0 -> may be unloaded */ /* functions supported by all types of modules */ -- cgit v1.2.3 From 87f8ac6dc4343eb4664ca5e234c163c399afca1b Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Fri, 4 Mar 2011 07:55:53 +0100 Subject: bugfix: regression: memory leak in module loader Signed-off-by: Rainer Gerhards --- runtime/modules.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/modules.h') diff --git a/runtime/modules.h b/runtime/modules.h index 7eff8581..4daaf1f9 100644 --- a/runtime/modules.h +++ b/runtime/modules.h @@ -77,9 +77,9 @@ typedef enum eModLinkType_ { /* remember which shared libs we dlopen()-ed */ struct dlhandle_s { - uchar szName[PATH_MAX]; - void *pModHdlr; - struct dlhandle_s *next; + uchar *pszName; + void *pModHdlr; + struct dlhandle_s *next; }; /* should this module be kept linked? */ -- cgit v1.2.3