diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-09 15:44:39 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-09 15:44:39 +0200 |
commit | fccb97d4dcb905293b9b704b7647f59b95b1d1ae (patch) | |
tree | 74dcad682834592e43fe918d649b81c1893fb7de /tools | |
parent | d85efd07e006d4d9031019aa9ac9757d303a8b36 (diff) | |
parent | 98d1ed504ec001728955a5bcd7916f64cd85f39f (diff) | |
download | rsyslog-fccb97d4dcb905293b9b704b7647f59b95b1d1ae.tar.gz rsyslog-fccb97d4dcb905293b9b704b7647f59b95b1d1ae.tar.xz rsyslog-fccb97d4dcb905293b9b704b7647f59b95b1d1ae.zip |
Merge branch 'beta'
Diffstat (limited to 'tools')
-rw-r--r-- | tools/syslogd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c index 0f4f8a23..8c4c8e94 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -1205,8 +1205,6 @@ int parseLegacySyslogMsg(msg_t *pMsg, int flags) assert(pMsg != NULL); assert(pMsg->pszRawMsg != NULL); lenMsg = pMsg->iLenRawMsg - (pMsg->offAfterPRI + 1); -RUNLOG_VAR("%d", pMsg->offAfterPRI); -RUNLOG_VAR("%d", lenMsg); p2parse = pMsg->pszRawMsg + pMsg->offAfterPRI; /* point to start of text, after PRI */ /* Check to see if msg contains a timestamp. We start by assuming @@ -1262,16 +1260,16 @@ RUNLOG_VAR("%d", lenMsg); bTAGCharDetected = 0; if(lenMsg > 0 && flags & PARSE_HOSTNAME) { i = 0; - while(lenMsg > 0 && (isalnum(p2parse[i]) || p2parse[i] == '.' || p2parse[i] == '.' + while(i < lenMsg && (isalnum(p2parse[i]) || p2parse[i] == '.' || p2parse[i] == '.' || p2parse[i] == '_' || p2parse[i] == '-') && i < CONF_TAG_MAXSIZE) { bufParseHOSTNAME[i] = p2parse[i]; ++i; - --lenMsg; } if(i > 0 && p2parse[i] == ' ' && isalnum(p2parse[i-1])) { /* we got a hostname! */ p2parse += i + 1; /* "eat" it (including SP delimiter) */ + lenMsg -= i + 1; bufParseHOSTNAME[i] = '\0'; MsgSetHOSTNAME(pMsg, bufParseHOSTNAME, i); } @@ -1738,8 +1736,6 @@ die(int sig) */ tplDeleteAll(); - remove_pid(PidFile); - /* de-init some modules */ modExitIminternal(); @@ -1773,6 +1769,9 @@ die(int sig) */ freeAllDynMemForTermination(); /* NO CODE HERE - feeelAllDynMemForTermination() must be the last thing before exit()! */ + + remove_pid(PidFile); + exit(0); /* "good" exit, this is the terminator function for rsyslog [die()] */ } |