mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-21 20:40:42 +01:00
changed calling interface for freeInstance() - need to work with dual
buffers in order to change output modules one by one
This commit is contained in:
parent
4c69b80ca0
commit
a3192ac18e
@ -45,8 +45,10 @@ static rsRetVal createInstance(instanceData **ppData)\
|
||||
instanceData *pData; /* use this to point to data elements */
|
||||
|
||||
#define CODESTARTcreateInstance \
|
||||
if((pData = calloc(1, sizeof(instanceData))) == NULL)\
|
||||
return RS_RET_OUT_OF_MEMORY;
|
||||
if((pData = calloc(1, sizeof(instanceData))) == NULL) {\
|
||||
*ppData = NULL;\
|
||||
return RS_RET_OUT_OF_MEMORY;\
|
||||
}
|
||||
|
||||
#define ENDcreateInstance \
|
||||
*ppData = pData;\
|
||||
@ -56,14 +58,18 @@ static rsRetVal createInstance(instanceData **ppData)\
|
||||
/* freeInstance()
|
||||
*/
|
||||
#define BEGINfreeInstance \
|
||||
static rsRetVal freeInstance(selector_t *f)\
|
||||
static rsRetVal freeInstance(selector_t *f, void* pModData)\
|
||||
{\
|
||||
rsRetVal iRet = RS_RET_OK;
|
||||
rsRetVal iRet = RS_RET_OK;\
|
||||
instanceData *pData;
|
||||
|
||||
#define CODESTARTfreeInstance \
|
||||
assert(f != NULL);
|
||||
assert(f != NULL);\
|
||||
pData = (instanceData*) pModData;
|
||||
|
||||
#define ENDfreeInstance \
|
||||
if(pData != NULL)\
|
||||
free(pData); /* we need to free this in any case */\
|
||||
return iRet;\
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ typedef struct moduleInfo {
|
||||
/* be sure to support version handshake! */
|
||||
rsRetVal (*modQueryEtryPt)(uchar *name, rsRetVal (**EtryPoint)()); /* query entry point addresses */
|
||||
rsRetVal (*isCompatibleWithFeature)(syslogFeature);
|
||||
rsRetVal (*freeInstance)(struct filed*);/* called before termination or module unload */
|
||||
rsRetVal (*freeInstance)(struct filed*, void*);/* called before termination or module unload */
|
||||
rsRetVal (*modExit)(); /* called before termination or module unload */
|
||||
/* below: parse a configuration line - return if processed
|
||||
* or not. If not, must be parsed to next module.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user