summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/omfile.c2
-rw-r--r--tools/pmrfc3164.c2
-rw-r--r--tools/pmrfc5424.c4
-rw-r--r--tools/syslogd.c13
4 files changed, 13 insertions, 8 deletions
diff --git a/tools/omfile.c b/tools/omfile.c
index de3cb4f6..90b452bf 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -838,7 +838,7 @@ CODESTARTnewActInst
}
CHKiRet(OMSRsetEntry(*ppOMSR, 0, ustrdup((pData->tplName == NULL) ?
- (uchar*)"RSYSLOG_FileFormat" : (uchar*)"??"),
+ (uchar*)"RSYSLOG_FileFormat" : pData->tplName),
OMSR_NO_RQD_TPL_OPTS));
if(pData->bDynamicName) {
diff --git a/tools/pmrfc3164.c b/tools/pmrfc3164.c
index 6d2d22b1..2657780d 100644
--- a/tools/pmrfc3164.c
+++ b/tools/pmrfc3164.c
@@ -75,7 +75,6 @@ ENDisCompatibleWithFeature
BEGINparse
uchar *p2parse;
int lenMsg;
- int bTAGCharDetected;
int i; /* general index for parsing */
uchar bufParseTAG[CONF_TAG_MAXSIZE];
uchar bufParseHOSTNAME[CONF_HOSTNAME_MAXSIZE];
@@ -137,7 +136,6 @@ CODESTARTparse
* 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 && pMsg->msgFlags & PARSE_HOSTNAME) {
i = 0;
while(i < lenMsg && (isalnum(p2parse[i]) || p2parse[i] == '.' || p2parse[i] == '.'
diff --git a/tools/pmrfc5424.c b/tools/pmrfc5424.c
index b06f1347..9b5c6165 100644
--- a/tools/pmrfc5424.c
+++ b/tools/pmrfc5424.c
@@ -106,7 +106,7 @@ static int parseRFCField(uchar **pp2parse, uchar *pResult, int *pLenStr)
/* set the new parse pointer */
*pp2parse = p2parse;
- return 0;
+ return iRet;
}
@@ -191,7 +191,7 @@ static int parseRFCStructuredData(uchar **pp2parse, uchar *pResult, int *pLenStr
/* set the new parse pointer */
*pp2parse = p2parse;
*pLenStr = lenStr;
- return 0;
+ return iRet;
}
/* parse a RFC5424-formatted syslog message. This function returns
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 04379dfb..44e60b1c 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -849,6 +849,11 @@ die(int sig)
errno = 0;
logmsgInternal(NO_ERRCODE, LOG_SYSLOG|LOG_INFO, (uchar*)buf, 0);
}
+ /* we sleep for 50ms to give the queue a chance to pick up the exit message;
+ * otherwise we have seen cases where the message did not make it to log
+ * files, even on idle systems.
+ */
+ srSleep(0, 50);
/* drain queue (if configured so) and stop main queue worker thread pool */
DBGPRINTF("Terminating main queue...\n");
@@ -1663,7 +1668,7 @@ doGlblProcessInit(void)
if( !(Debug == DEBUG_FULL || NoFork) )
{
- DBGPRINTF("Checking pidfile.\n");
+ DBGPRINTF("Checking pidfile '%s'.\n", PidFile);
if (!check_pid(PidFile))
{
memset(&sigAct, 0, sizeof (sigAct));
@@ -1671,6 +1676,9 @@ doGlblProcessInit(void)
sigAct.sa_handler = doexit;
sigaction(SIGTERM, &sigAct, NULL);
+ /* stop writing debug messages to stdout (if debugging is on) */
+ stddbg = -1;
+
if (fork()) {
/* Parent process
*/
@@ -1733,7 +1741,7 @@ doGlblProcessInit(void)
}
/* tuck my process id away */
- DBGPRINTF("Writing pidfile %s.\n", PidFile);
+ DBGPRINTF("Writing pidfile '%s'.\n", PidFile);
if (!check_pid(PidFile))
{
if (!write_pid(PidFile))
@@ -1781,7 +1789,6 @@ doGlblProcessInit(void)
int realMain(int argc, char **argv)
{
rsRetVal localRet;
- register uchar *p;
int ch;
extern int optind;
extern char *optarg;