From ddcb7d9af0ed6641303be6001270b77a2b70257f Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Oct 2010 09:58:07 +0200 Subject: bugfix: imfile utilizes 32 bit to track offset Most importantly, this problem can not experienced on recent Fedora 64 bit OS (which has 64 bit long's!) --- ChangeLog | 5 +++++ plugins/imfile/imfile.c | 5 ++++- runtime/stream.c | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b16824d..5b9e8fbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ --------------------------------------------------------------------------- +Version 4.4.2a [private build] (rgerhards), 2010-10-15 +- bugfix: imfile utilizes 32 bit to track offset. Most importantly, + this problem can not experienced on Fedora 64 bit OS (which has + 64 bit long's!) +--------------------------------------------------------------------------- Version 4.4.2 [v4-stable] (rgerhards), 2009-10-09 - bugfix: invalid handling of zero-sized messages, could lead to mis- addressing and potential memory corruption/segfault diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c index 927cb82e..1ae6e69a 100644 --- a/plugins/imfile/imfile.c +++ b/plugins/imfile/imfile.c @@ -349,12 +349,15 @@ persistStrmState(fileInfo_t *pInfo) { DEFiRet; strm_t *psSF = NULL; /* state file (stream) */ + size_t lenDir; ASSERT(pInfo != NULL); /* TODO: create a function persistObj in obj.c? */ CHKiRet(strmConstruct(&psSF)); - CHKiRet(strmSetDir(psSF, glbl.GetWorkDir(), strlen((char*)glbl.GetWorkDir()))); + lenDir = strlen((char*)glbl.GetWorkDir()); + if(lenDir > 0) + CHKiRet(strmSetDir(psSF, glbl.GetWorkDir(), lenDir)); CHKiRet(strmSettOperationsMode(psSF, STREAMMODE_WRITE)); CHKiRet(strmSetiAddtlOpenFlags(psSF, O_TRUNC)); CHKiRet(strmSetsType(psSF, STREAMTYPE_FILE_SINGLE)); diff --git a/runtime/stream.c b/runtime/stream.c index 1cff2da6..267e8687 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -779,7 +779,7 @@ rsRetVal strmSerialize(strm_t *pThis, strm_t *pStrm) { DEFiRet; int i; - long l; + int64 l; ISOBJ_TYPE_assert(pThis, strm); ISOBJ_TYPE_assert(pStrm, strm); @@ -801,8 +801,8 @@ rsRetVal strmSerialize(strm_t *pThis, strm_t *pStrm) i = pThis->tOpenMode; objSerializeSCALAR_VAR(pStrm, tOpenMode, INT, i); - l = (long) pThis->iCurrOffs; - objSerializeSCALAR_VAR(pStrm, iCurrOffs, LONG, l); + l = pThis->iCurrOffs; + objSerializeSCALAR_VAR(pStrm, iCurrOffs, INT64, l); CHKiRet(obj.EndSerialize(pStrm)); -- cgit From 205410c23ade6c7321fc984af26c3d2f590dc1aa Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Oct 2010 06:37:58 -0700 Subject: bugfix: a couple of problems that imfile had on some platforms namely Ubuntu (not their fault, but occured there) --- ChangeLog | 2 ++ runtime/stream.c | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b9e8fbc..7176d295 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 4.4.2a [private build] (rgerhards), 2010-10-15 +- bugfix: a couple of problems that imfile had on some platforms, namely + Ubuntu (not their fault, but occured there) - bugfix: imfile utilizes 32 bit to track offset. Most importantly, this problem can not experienced on Fedora 64 bit OS (which has 64 bit long's!) diff --git a/runtime/stream.c b/runtime/stream.c index 267e8687..9997e685 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -96,10 +96,12 @@ static rsRetVal strmOpenFile(strm_t *pThis) iFlags |= pThis->iAddtlOpenFlags; - pThis->fd = open((char*)pThis->pszCurrFName, iFlags, pThis->tOpenMode); + pThis->fd = open((char*)pThis->pszCurrFName, iFlags | O_LARGEFILE, pThis->tOpenMode); if(pThis->fd == -1) { int ierrnoSave = errno; - dbgoprint((obj_t*) pThis, "open error %d, file '%s'\n", errno, pThis->pszCurrFName); + char errmsg[1024]; + dbgoprint((obj_t*) pThis, "open error %d, file '%s': %s\n", errno, pThis->pszCurrFName, + rs_strerror_r(errno, errmsg, sizeof(errmsg))); if(ierrnoSave == ENOENT) ABORT_FINALIZE(RS_RET_FILE_NOT_FOUND); else @@ -522,7 +524,7 @@ rsRetVal strmFlush(strm_t *pThis) * is invalidated. * rgerhards, 2008-01-12 */ -static rsRetVal strmSeek(strm_t *pThis, off_t offs) +static rsRetVal strmSeek(strm_t *pThis, off64_t offs) { DEFiRet; @@ -532,9 +534,9 @@ static rsRetVal strmSeek(strm_t *pThis, off_t offs) strmOpenFile(pThis); else strmFlush(pThis); - int i; + int64 i; dbgoprint((obj_t*) pThis, "file %d seek, pos %ld\n", pThis->fd, (long) offs); - i = lseek(pThis->fd, offs, SEEK_SET); // TODO: check error! + i = lseek64(pThis->fd, offs, SEEK_SET); pThis->iCurrOffs = offs; /* we are now at *this* offset */ pThis->iBufPtr = 0; /* buffer invalidated */ -- cgit From d1846d8561fe5ecce13248b7b34333362d050c01 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 15 Oct 2010 11:23:03 +0200 Subject: patched version number --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 66a2d70d..7b4797aa 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[4.4.2],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[4.4.2a],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([ChangeLog]) AC_CONFIG_MACRO_DIR([m4]) -- cgit From da8670d37a49ebda19dea708f716ad66a75f94e4 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 24 Nov 2010 15:57:59 +0100 Subject: final preparations for release --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 71f7aef0..5d25cd76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ --------------------------------------------------------------------------- -Version 4.6.5 [v4-stable] (rgerhards), 2010-??-?? +Version 4.6.5 [v4-stable] (rgerhards), 2010-11-24 - bugfix(important): problem in TLS handling could cause rsyslog to loop in a tight loop, effectively disabling functionality and bearing the risk of unresponsiveness of the whole system. -- cgit From d2dc913edc7bc4e0880f4dd6eb4aff495adb8138 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 30 Nov 2010 15:48:48 +0100 Subject: typo fix (thanks to Björn Påhlsson for finding it!) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rainer Gerhards --- doc/rsyslog_conf_filter.html | 4 ++-- tools/rsyslog.conf.5 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/rsyslog_conf_filter.html b/doc/rsyslog_conf_filter.html index 63c29817..34839616 100644 --- a/doc/rsyslog_conf_filter.html +++ b/doc/rsyslog_conf_filter.html @@ -85,12 +85,12 @@ selector field is capable to overwrite the preceding ones. Using this behavior you can exclude some priorities from the pattern.

Rsyslogd has a syntax extension to the original BSD source, that makes its use more intuitively. You may precede every priority -with an equation sign ("='') to specify only this single priority and +with an equals sign ("='') to specify only this single priority and not any of the above. You may also (both is valid, too) precede the priority with an exclamation mark ("!'') to ignore all that priorities, either exact this one or this and any higher priority. If you use both extensions than the exclamation mark must occur before the -equation sign, just use it intuitively.

+equals sign, just use it intuitively.

Property-Based Filters

Property-based filters are unique to rsyslogd. They allow to filter on any property, like HOSTNAME, syslogtag and msg. A list of all diff --git a/tools/rsyslog.conf.5 b/tools/rsyslog.conf.5 index e8a4ab92..e17da974 100644 --- a/tools/rsyslog.conf.5 +++ b/tools/rsyslog.conf.5 @@ -200,11 +200,11 @@ to overwrite the preceding ones. Using this behavior you can exclude some priorities from the pattern. Rsyslogd has a syntax extension to the original BSD source, that makes its use -more intuitively. You may precede every priority with an equation sign ('=') to +more intuitively. You may precede every priority with an equals sign ('=') to specify only this single priority and not any of the above. You may also (both is valid, too) precede the priority with an exclamation mark ('!') to ignore all that priorities, either exact this one or this and any higher priority. If -you use both extensions than the exclamation mark must occur before the equation +you use both extensions than the exclamation mark must occur before the equals sign, just use it intuitively. .SH ACTIONS -- cgit From ec6230cffe6e06957113d53272d00dc859a3e617 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 16 Dec 2010 12:16:54 +0100 Subject: improved some code based on clang static analyzer results --- ChangeLog | 3 +++ runtime/conf.c | 2 +- runtime/ctok.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e17ef35d..a50c4ee0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ --------------------------------------------------------------------------- +Version 3.22.4 [v3-stable] (rgerhards), 2010-??-?? +- improved some code based on clang static analyzer results +--------------------------------------------------------------------------- Version 3.22.3 [v3-stable] (rgerhards), 2010-11-24 - bugfix(important): problem in TLS handling could cause rsyslog to loop in a tight loop, effectively disabling functionality and bearing the diff --git a/runtime/conf.c b/runtime/conf.c index 001b501d..efe9c516 100644 --- a/runtime/conf.c +++ b/runtime/conf.c @@ -1054,7 +1054,7 @@ static rsRetVal cflineDoAction(uchar **p, action_t **ppAction) DEFiRet; modInfo_t *pMod; omodStringRequest_t *pOMSR; - action_t *pAction; + action_t *pAction = NULL; void *pModData; ASSERT(p != NULL); diff --git a/runtime/ctok.c b/runtime/ctok.c index 71a10a20..7dd5f8b0 100644 --- a/runtime/ctok.c +++ b/runtime/ctok.c @@ -1,4 +1,4 @@ -/* cfgtok.c - helper class to tokenize an input stream - which surprisingly +/* ctok.c - helper class to tokenize an input stream - which surprisingly * currently does not work with streams but with string. But that will * probably change over time ;) This class was originally written to support * the expression module but may evolve when (if) the expression module is @@ -267,7 +267,7 @@ ctokGetVar(ctok_t *pThis, ctok_token_t *pToken) { DEFiRet; uchar c; - cstr_t *pstrVal; + cstr_t *pstrVal = NULL; ISOBJ_TYPE_assert(pThis, ctok); ASSERT(pToken != NULL); -- cgit From 371a8eec29fa25bbf58f4b1f0d7e3bf4c3ad6329 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 16 Dec 2010 12:57:55 +0100 Subject: some cleanup based on clang static analyzer results --- ChangeLog | 4 ++++ plugins/imklog/ksym.c | 4 +--- runtime/cfsysline.c | 4 ++-- runtime/debug.c | 6 ++---- runtime/msg.c | 4 +--- runtime/parser.c | 2 -- runtime/queue.c | 5 ++--- runtime/wtp.c | 2 +- template.c | 10 ++++------ threads.c | 3 +-- tools/omfile.c | 1 - tools/omfwd.c | 2 -- tools/omusrmsg.c | 1 - tools/syslogd.c | 2 -- 14 files changed, 18 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 731939d8..3c7d3c4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ Version 4.6.6 [v4-stable] (rgerhards), 2010-11-?? - bugfix: imfile utilizes 32 bit to track offset. Most importantly, this problem can not experienced on Fedora 64 bit OS (which has 64 bit long's!) +- some improvements thanks to clang's static code analyzer + o overall cleanup (mostly unnecessary writes and otherwise unused stuff) + o bugfix: fixed a very remote problem in msg.c which could occur when + running under extremely low memory conditions --------------------------------------------------------------------------- Version 4.6.5 [v4-stable] (rgerhards), 2010-11-24 - bugfix(important): problem in TLS handling could cause rsyslog to loop diff --git a/plugins/imklog/ksym.c b/plugins/imklog/ksym.c index f636a7bb..ca708ba6 100644 --- a/plugins/imklog/ksym.c +++ b/plugins/imklog/ksym.c @@ -650,8 +650,7 @@ static void FreeSymbols(void) **************************************************************************/ extern char *ExpandKadds(char *line, char *el) { - auto char dlm, - *kp, + auto char *kp, *sl = line, *elp = el, *symbol; @@ -781,7 +780,6 @@ extern char *ExpandKadds(char *line, char *el) strcpy(el, sl); return(el); } - dlm = *kp; strncpy(num,sl+1,kp-sl-1); num[kp-sl-1] = '\0'; value = strtoul(num, (char **) 0, 16); diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c index 469fbfc2..1dd5905e 100644 --- a/runtime/cfsysline.c +++ b/runtime/cfsysline.c @@ -961,11 +961,11 @@ void dbgPrintCfSysLineHandlers(void) dbgprintf("Sytem Line Configuration Commands:\n"); llCookieCmd = NULL; - while((iRet = llGetNextElt(&llCmdList, &llCookieCmd, (void*)&pCmd)) == RS_RET_OK) { + while(llGetNextElt(&llCmdList, &llCookieCmd, (void*)&pCmd) == RS_RET_OK) { llGetKey(llCookieCmd, (void*) &pKey); /* TODO: using the cookie is NOT clean! */ dbgprintf("\tCommand '%s':\n", pKey); llCookieCmdHdlr = NULL; - while((iRet = llGetNextElt(&pCmd->llCmdHdlrs, &llCookieCmdHdlr, (void*)&pCmdHdlr)) == RS_RET_OK) { + while(llGetNextElt(&pCmd->llCmdHdlrs, &llCookieCmdHdlr, (void*)&pCmdHdlr) == RS_RET_OK) { dbgprintf("\t\ttype : %d\n", pCmdHdlr->eType); dbgprintf("\t\tpData: 0x%lx\n", (unsigned long) pCmdHdlr->pData); dbgprintf("\t\tHdlr : 0x%lx\n", (unsigned long) pCmdHdlr->cslCmdHdlr); diff --git a/runtime/debug.c b/runtime/debug.c index 9b7c2952..6bb8d743 100644 --- a/runtime/debug.c +++ b/runtime/debug.c @@ -433,14 +433,13 @@ dbgMutLog_t *dbgMutLogFindHolder(pthread_mutex_t *pmut) static inline void dbgMutexPreLockLog(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncDB, int ln) { dbgMutLog_t *pHolder; - dbgMutLog_t *pLog; char pszBuf[128]; char pszHolderThrdName[64]; char *pszHolder; pthread_mutex_lock(&mutMutLog); pHolder = dbgMutLogFindHolder(pmut); - pLog = dbgMutLogAddEntry(pmut, MUTOP_LOCKWAIT, pFuncDB, ln); + dbgMutLogAddEntry(pmut, MUTOP_LOCKWAIT, pFuncDB, ln); if(pHolder == NULL) pszHolder = "[NONE]"; @@ -481,14 +480,13 @@ static inline void dbgMutexLockLog(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncDB, static inline void dbgMutexPreTryLockLog(pthread_mutex_t *pmut, dbgFuncDB_t *pFuncDB, int ln) { dbgMutLog_t *pHolder; - dbgMutLog_t *pLog; char pszBuf[128]; char pszHolderThrdName[64]; char *pszHolder; pthread_mutex_lock(&mutMutLog); pHolder = dbgMutLogFindHolder(pmut); - pLog = dbgMutLogAddEntry(pmut, MUTOP_TRYLOCK, pFuncDB, ln); + dbgMutLogAddEntry(pmut, MUTOP_TRYLOCK, pFuncDB, ln); if(pHolder == NULL) pszHolder = "[NONE]"; diff --git a/runtime/msg.c b/runtime/msg.c index f5041b85..a9a09143 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -1476,7 +1476,7 @@ rsRetVal MsgSetPROCID(msg_t *pMsg, char* pszPROCID) CHKiRet(cstrConstruct(&pMsg->pCSPROCID)); } /* if we reach this point, we have the object */ - iRet = rsCStrSetSzStr(pMsg->pCSPROCID, (uchar*) pszPROCID); + CHKiRet(rsCStrSetSzStr(pMsg->pCSPROCID, (uchar*) pszPROCID)); CHKiRet(cstrFinalize(pMsg->pCSPROCID)); finalize_it: @@ -2872,7 +2872,6 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, if(pTpe->data.field.options.bCSV) { /* we need to obtain a private copy, as we need to at least add the double quotes */ int iBufLen; - int i; uchar *pBStart; uchar *pDst; uchar *pSrc; @@ -2887,7 +2886,6 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, RET_OUT_OF_MEMORY; } pSrc = pRes; - i = 0; *pDst++ = '"'; /* starting quote */ while(*pSrc) { if(*pSrc == '"') diff --git a/runtime/parser.c b/runtime/parser.c index 36e88ebd..d27f3e38 100644 --- a/runtime/parser.c +++ b/runtime/parser.c @@ -272,7 +272,6 @@ rsRetVal parseMsg(msg_t *pMsg) uchar *msg; int pri; int lenMsg; - int iPriText; if(pMsg->iLenRawMsg == 0) ABORT_FINALIZE(RS_RET_EMPTY_MSG); @@ -286,7 +285,6 @@ rsRetVal parseMsg(msg_t *pMsg) lenMsg = pMsg->iLenRawMsg; msg = pMsg->pszRawMsg; pri = DEFUPRI; - iPriText = 0; if(*msg == '<') { /* while we process the PRI, we also fill the PRI textual representation * inside the msg object. This may not be ideal from an OOP point of view, diff --git a/runtime/queue.c b/runtime/queue.c index 9d7a9058..39898718 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -685,7 +685,6 @@ qqueueHaveQIF(qqueue_t *pThis) { DEFiRet; uchar pszQIFNam[MAXFNAME]; - size_t lenQIFNam; struct stat stat_buf; ISOBJ_TYPE_assert(pThis, qqueue); @@ -694,8 +693,8 @@ qqueueHaveQIF(qqueue_t *pThis) ABORT_FINALIZE(RS_RET_NO_FILEPREFIX); /* Construct file name */ - lenQIFNam = snprintf((char*)pszQIFNam, sizeof(pszQIFNam) / sizeof(uchar), "%s/%s.qi", - (char*) glbl.GetWorkDir(), (char*)pThis->pszFilePrefix); + snprintf((char*)pszQIFNam, sizeof(pszQIFNam) / sizeof(uchar), "%s/%s.qi", + (char*) glbl.GetWorkDir(), (char*)pThis->pszFilePrefix); /* check if the file exists */ if(stat((char*) pszQIFNam, &stat_buf) == -1) { diff --git a/runtime/wtp.c b/runtime/wtp.c index 0c66dd11..f71d5855 100644 --- a/runtime/wtp.c +++ b/runtime/wtp.c @@ -460,7 +460,7 @@ wtpWorker(void *arg) /* the arg is actually a wti object, even though we are in do { END_MTX_PROTECTED_OPERATIONS(&pThis->mut); - iRet = wtiWorker(pWti); /* just to make sure: this is NOT protected by the mutex! */ + wtiWorker(pWti); /* just to make sure: this is NOT protected by the mutex! */ BEGIN_MTX_PROTECTED_OPERATIONS(&pThis->mut, LOCK_MUTEX); } while(pThis->iCurNumWrkThrd == 1 && pThis->bInactivityGuard == 1); diff --git a/template.c b/template.c index 68c57be1..a5331d57 100644 --- a/template.c +++ b/template.c @@ -82,9 +82,9 @@ rsRetVal tplToString(struct template *pTpl, msg_t *pMsg, uchar **ppBuf, size_t * DEFiRet; struct templateEntry *pTpe; int iBuf; - unsigned short bMustBeFreed; + unsigned short bMustBeFreed = 0; uchar *pVal; - size_t iLenVal; + size_t iLenVal = 0; assert(pTpl != NULL); assert(pMsg != NULL); @@ -980,7 +980,6 @@ void tplDeleteAll(void) { struct template *pTpl, *pTplDel; struct templateEntry *pTpe, *pTpeDel; - rsRetVal iRetLocal; BEGINfunc pTpl = tplRoot; @@ -1003,7 +1002,7 @@ void tplDeleteAll(void) case FIELD: /* check if we have a regexp and, if so, delete it */ if(pTpeDel->data.field.has_regex != 0) { - if((iRetLocal = objUse(regexp, LM_REGEXP_FILENAME)) == RS_RET_OK) { + if(objUse(regexp, LM_REGEXP_FILENAME) == RS_RET_OK) { regexp.regfree(&(pTpeDel->data.field.re)); } } @@ -1029,7 +1028,6 @@ void tplDeleteNew(void) { struct template *pTpl, *pTplDel; struct templateEntry *pTpe, *pTpeDel; - rsRetVal iRetLocal; BEGINfunc @@ -1058,7 +1056,7 @@ void tplDeleteNew(void) case FIELD: /* check if we have a regexp and, if so, delete it */ if(pTpeDel->data.field.has_regex != 0) { - if((iRetLocal = objUse(regexp, LM_REGEXP_FILENAME)) == RS_RET_OK) { + if(objUse(regexp, LM_REGEXP_FILENAME) == RS_RET_OK) { regexp.regfree(&(pTpeDel->data.field.re)); } } diff --git a/threads.c b/threads.c index 13222694..051903de 100644 --- a/threads.c +++ b/threads.c @@ -151,7 +151,6 @@ rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdI { DEFiRet; thrdInfo_t *pThis; - int i; assert(thrdMain != NULL); @@ -159,7 +158,7 @@ rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdI pThis->bIsActive = 1; pThis->pUsrThrdMain = thrdMain; pThis->pAfterRun = afterRun; - i = pthread_create(&pThis->thrdID, NULL, thrdStarter, pThis); + pthread_create(&pThis->thrdID, NULL, thrdStarter, pThis); CHKiRet(llAppend(&llThrds, NULL, pThis)); finalize_it: diff --git a/tools/omfile.c b/tools/omfile.c index 24de052c..487cf8a0 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -353,7 +353,6 @@ prepareFile(instanceData *pData, uchar *newFileName) if(access((char*)newFileName, F_OK) != 0) { /* file does not exist, create it (and eventually parent directories */ - fd = -1; if(pData->bCreateDirs) { /* We first need to create parent dirs if they are missing. * We do not report any errors here ourselfs but let the code diff --git a/tools/omfwd.c b/tools/omfwd.c index cbfc36a4..96b365a0 100644 --- a/tools/omfwd.c +++ b/tools/omfwd.c @@ -515,7 +515,6 @@ finalize_it: BEGINparseSelectorAct uchar *q; int i; - int bErr; rsRetVal localRet; struct addrinfo; TCPFRAMINGMODE tcp_framing = TCP_FRAMING_OCTET_STUFFING; @@ -638,7 +637,6 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1) } /* now skip to template */ - bErr = 0; while(*p && *p != ';' && *p != '#' && !isspace((int) *p)) ++p; /*JUST SKIP*/ diff --git a/tools/omusrmsg.c b/tools/omusrmsg.c index e61751dc..768baca7 100644 --- a/tools/omusrmsg.c +++ b/tools/omusrmsg.c @@ -249,7 +249,6 @@ static rsRetVal wallmsg(uchar* pMsg, instanceData *pData) } } close(ttyf); - ttyf = -1; } } diff --git a/tools/syslogd.c b/tools/syslogd.c index a03dcf0e..12d94e9a 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1190,7 +1190,6 @@ int parseLegacySyslogMsg(msg_t *pMsg, int flags) { uchar *p2parse; int lenMsg; - int bTAGCharDetected; int i; /* general index for parsing */ uchar bufParseTAG[CONF_TAG_MAXSIZE]; uchar bufParseHOSTNAME[CONF_HOSTNAME_MAXSIZE]; @@ -1251,7 +1250,6 @@ int parseLegacySyslogMsg(msg_t *pMsg, int flags) * rgerhards, 2009-06-23: and I now have extended this logic to every character * that is not a valid hostname. */ - bTAGCharDetected = 0; if(lenMsg > 0 && flags & PARSE_HOSTNAME) { i = 0; while(i < lenMsg && (isalnum(p2parse[i]) || p2parse[i] == '.' || p2parse[i] == '.' -- cgit