diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-10 13:23:53 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-10 13:23:53 +0000 |
commit | 46d0a95fc1680bdef960260fba98d06ba7336d0d (patch) | |
tree | e9e93c65fb8547280e19e158d8f1e18f246712ed | |
parent | 4c1002deed0236488e7c4d2e1e6e2f44d57cd698 (diff) | |
download | rsyslog-46d0a95fc1680bdef960260fba98d06ba7336d0d.tar.gz rsyslog-46d0a95fc1680bdef960260fba98d06ba7336d0d.tar.xz rsyslog-46d0a95fc1680bdef960260fba98d06ba7336d0d.zip |
changed some config parameters and some cleanup
-rw-r--r-- | msg.c | 2 | ||||
-rw-r--r-- | obj.c | 2 | ||||
-rw-r--r-- | obj.h | 2 | ||||
-rw-r--r-- | queue.c | 6 | ||||
-rw-r--r-- | syslogd.c | 24 | ||||
-rw-r--r-- | syslogd.h | 1 |
6 files changed, 18 insertions, 19 deletions
@@ -414,7 +414,7 @@ static rsRetVal MsgSerialize(msg_t *pThis, strm_t *pStrm) objSerializePTR(pStrm, pCSPROCID, CSTR); objSerializePTR(pStrm, pCSMSGID, CSTR); - CHKiRet(objEndSerialize(pStrm, (obj_t*) pThis)); + CHKiRet(objEndSerialize(pStrm)); finalize_it: return iRet; @@ -265,7 +265,7 @@ finalize_it: /* end serialization of an object. The caller receives a * standard C string, which he must free when no longer needed. */ -rsRetVal objEndSerialize(strm_t *pStrm, obj_t *pObj) +rsRetVal objEndSerialize(strm_t *pStrm) { DEFiRet; @@ -80,7 +80,7 @@ rsRetVal objInfoConstruct(objInfo_t **ppThis, objID_t objID, uchar *pszName, int rsRetVal objInfoSetMethod(objInfo_t *pThis, objMethod_t objMethod, rsRetVal (*pHandler)(void*)); rsRetVal objBeginSerialize(strm_t *pStrm, obj_t *pObj); rsRetVal objSerializeProp(strm_t *pStrm, uchar *pszPropName, propertyType_t propType, void *pUsr); -rsRetVal objEndSerialize(strm_t *pStrm, obj_t *pObj); +rsRetVal objEndSerialize(strm_t *pStrm); rsRetVal objRegisterObj(objID_t oID, objInfo_t *pInfo); rsRetVal objDeserialize(void *ppObj, objID_t objTypeExpected, strm_t *pSerStore); PROTOTYPEObjClassInit(obj); @@ -203,14 +203,14 @@ static rsRetVal qConstructDisk(queue_t *pThis) assert(pThis != NULL); CHKiRet(strmConstruct(&pThis->tVars.disk.pWrite)); - CHKiRet(strmSetDir(pThis->tVars.disk.pWrite, pszSpoolDirectory, strlen((char*)pszSpoolDirectory))); + CHKiRet(strmSetDir(pThis->tVars.disk.pWrite, glblGetWorkDir(), strlen((char*)glblGetWorkDir()))); CHKiRet(strmSetiMaxFiles(pThis->tVars.disk.pWrite, 10000000)); CHKiRet(strmSettOperationsMode(pThis->tVars.disk.pWrite, STREAMMODE_WRITE)); CHKiRet(strmConstructFinalize(pThis->tVars.disk.pWrite)); CHKiRet(strmConstruct(&pThis->tVars.disk.pRead)); CHKiRet(strmSetbDeleteOnClose(pThis->tVars.disk.pRead, 1)); - CHKiRet(strmSetDir(pThis->tVars.disk.pRead, pszSpoolDirectory, strlen((char*)pszSpoolDirectory))); + CHKiRet(strmSetDir(pThis->tVars.disk.pRead, glblGetWorkDir(), strlen((char*)glblGetWorkDir()))); CHKiRet(strmSetiMaxFiles(pThis->tVars.disk.pRead, 10000000)); CHKiRet(strmSettOperationsMode(pThis->tVars.disk.pRead, STREAMMODE_READ)); CHKiRet(strmConstructFinalize(pThis->tVars.disk.pRead)); @@ -425,7 +425,7 @@ rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iWorkerThreads, } /* we have an object, so let's fill the properties */ - if((pThis->pszSpoolDir = (uchar*) strdup((char*)pszSpoolDirectory)) == NULL) + if((pThis->pszSpoolDir = (uchar*) strdup((char*)glblGetWorkDir())) == NULL) ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); pThis->lenSpoolDir = strlen((char*)pThis->pszSpoolDir); @@ -380,8 +380,8 @@ static int logEveryMsg = 0;/* no repeat message processing - read-only after st * 0 - suppress duplicate messages * 1 - do NOT suppress duplicate messages */ -uchar *pszSpoolDirectory = NULL;/* name of rsyslog's spool directory (without trailing slash) */ -uchar *pszMainMsgQFilePrefix = NULL;/* prefix for the main message queue file */ +uchar *pszWorkDir = NULL;/* name of rsyslog's spool directory (without trailing slash) */ +uchar *pszMainMsgQFName = NULL;/* prefix for the main message queue file */ size_t iMainMsgQueMaxFileSize = 1024*1024; /* end global config file state variables */ @@ -512,13 +512,13 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a free(pModDir); pModDir = NULL; } - if(pszSpoolDirectory != NULL) { - free(pszSpoolDirectory); - pszSpoolDirectory = NULL; + if(pszWorkDir != NULL) { + free(pszWorkDir); + pszWorkDir = NULL; } - if(pszMainMsgQFilePrefix != NULL) { - free(pszMainMsgQFilePrefix); - pszMainMsgQFilePrefix = NULL; + if(pszMainMsgQFName != NULL) { + free(pszMainMsgQFName); + pszMainMsgQFName = NULL; } iMainMsgQueueSize = 10000; iMainMsgQueMaxFileSize = 1024 * 1024; @@ -3122,7 +3122,7 @@ static void dbgPrintInitInfo(void) dbgprintf("Main queue size %d messages.\n", iMainMsgQueueSize); dbgprintf("Main queue worker threads: %d\n", iMainMsgQueueNumWorkers); - dbgprintf("Spool Directory: '%s'.\n", pszSpoolDirectory); + dbgprintf("Spool Directory: '%s'.\n", pszWorkDir); } @@ -3372,7 +3372,7 @@ init(void) setQPROP(queueSetMaxFileSize, "$MainMsgQueueFileSize", iMainMsgQueMaxFileSize); setQPROPstr(queueSetFilePrefix, "$MainMsgQueueFilePrefix", - (pszMainMsgQFilePrefix == NULL ? (uchar*) "mainq" : pszMainMsgQFilePrefix)); + (pszMainMsgQFName == NULL ? (uchar*) "mainq" : pszMainMsgQFName)); # undef setQPROP # undef setQPROPstr @@ -4512,8 +4512,8 @@ static rsRetVal loadBuildInModules(void) * is that rsyslog will terminate if we can not register our built-in config commands. * This, I think, is the right thing to do. -- rgerhards, 2007-07-31 */ - CHKiRet(regCfSysLineHdlr((uchar *)"spooldirectory", 0, eCmdHdlrGetWord, NULL, &pszSpoolDirectory, NULL)); - CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuefileprefix", 0, eCmdHdlrGetWord, NULL, &pszMainMsgQFilePrefix, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"workdirectory", 0, eCmdHdlrGetWord, NULL, &pszWorkDir, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuefilename", 0, eCmdHdlrGetWord, NULL, &pszMainMsgQFName, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuesize", 0, eCmdHdlrInt, NULL, &iMainMsgQueueSize, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueuetype", 0, eCmdHdlrGetWord, setMainMsgQueType, NULL, NULL)); CHKiRet(regCfSysLineHdlr((uchar *)"mainmsgqueueworkerthreads", 0, eCmdHdlrInt, NULL, &iMainMsgQueueNumWorkers, NULL)); @@ -82,6 +82,5 @@ extern char **StripDomains; extern char *LocalDomain; extern int bDropMalPTRMsgs; extern char ctty[]; -extern uchar *pszSpoolDirectory; #endif /* #ifndef SYSLOGD_H_INCLUDED */ |