diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-04-26 17:30:59 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-04-26 17:30:59 +0200 |
commit | 19c8bed08dbeb9ce0313ec92d7de85c9c51c4f48 (patch) | |
tree | 625acfbc535b2b84e0f4cfaf8ee322f38f0bbc2b /outchannel.c | |
parent | 8fb8c0d37b68d633e562bbc96f9971917620d181 (diff) | |
download | rsyslog-19c8bed08dbeb9ce0313ec92d7de85c9c51c4f48.tar.gz rsyslog-19c8bed08dbeb9ce0313ec92d7de85c9c51c4f48.tar.xz rsyslog-19c8bed08dbeb9ce0313ec92d7de85c9c51c4f48.zip |
step: outchannel list integrated into main config object
Diffstat (limited to 'outchannel.c')
-rw-r--r-- | outchannel.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/outchannel.c b/outchannel.c index b9b4a6b1..9a3733d8 100644 --- a/outchannel.c +++ b/outchannel.c @@ -37,12 +37,9 @@ #include <assert.h> #include "stringbuf.h" #include "outchannel.h" -#include "dirty.h" +#include "rsconf.h" #include "debug.h" -static struct outchannel *ochRoot = NULL; /* the root of the outchannel list */ -static struct outchannel *ochLast = NULL; /* points to the last element of the outchannel list */ - /* Constructs a outchannel list object. Returns pointer to it * or NULL (if it fails). */ @@ -55,14 +52,14 @@ struct outchannel* ochConstruct(void) /* basic initialisaion is done via calloc() - need to * initialize only values != 0. */ - if(ochLast == NULL) + if(loadConf->och.ochLast == NULL) { /* we are the first element! */ - ochRoot = ochLast = pOch; + loadConf->och.ochRoot = loadConf->och.ochLast = pOch; } else { - ochLast->pNext = pOch; - ochLast = pOch; + loadConf->och.ochLast->pNext = pOch; + loadConf->och.ochLast = pOch; } return(pOch); @@ -251,7 +248,7 @@ struct outchannel *ochFind(char *pName, int iLenName) assert(pName != NULL); - pOch = ochRoot; + pOch = loadConf->och.ochRoot; while(pOch != NULL && !(pOch->iLenName == iLenName && !strcmp(pOch->pszName, pName) @@ -270,7 +267,7 @@ void ochDeleteAll(void) { struct outchannel *pOch, *pOchDel; - pOch = ochRoot; + pOch = loadConf->och.ochRoot; while(pOch != NULL) { dbgprintf("Delete Outchannel: Name='%s'\n ", pOch->pszName == NULL? "NULL" : pOch->pszName); pOchDel = pOch; @@ -289,7 +286,7 @@ void ochPrintList(void) { struct outchannel *pOch; - pOch = ochRoot; + pOch = loadConf->och.ochRoot; while(pOch != NULL) { dbgprintf("Outchannel: Name='%s'\n", pOch->pszName == NULL? "NULL" : pOch->pszName); dbgprintf("\tFile Template: '%s'\n", pOch->pszFileTemplate == NULL ? "NULL" : (char*) pOch->pszFileTemplate); |