diff options
author | Michael Biebl <biebl@debian.org> | 2011-03-29 18:38:20 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2011-03-29 18:38:20 +0200 |
commit | bf9714f547781f6d18f260db7bafec62391dfd6b (patch) | |
tree | 8674c17aaacd8a235b6ca6e0cfb83f4c466db8b3 /runtime | |
parent | dea543841bb1f1c46586a68da21d55b44c6bf158 (diff) | |
download | rsyslog-bf9714f547781f6d18f260db7bafec62391dfd6b.tar.gz |
Imported Upstream version 5.7.10upstream/5.7.10
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/msg.c | 10 | ||||
-rw-r--r-- | runtime/parser.c | 6 | ||||
-rw-r--r-- | runtime/rsyslog.h | 1 |
3 files changed, 14 insertions, 3 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index b0261fa..e8e6096 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -444,6 +444,8 @@ rsRetVal propNameToID(cstr_t *pCSPropName, propid_t *pPropID) *pPropID = PROP_SYS_MINUTE; } else if(!strcmp((char*) pName, "$myhostname")) { *pPropID = PROP_SYS_MYHOSTNAME; + } else if(!strcmp((char*) pName, "$bom")) { + *pPropID = PROP_SYS_BOM; } else { *pPropID = PROP_INVALID; iRet = RS_RET_VAR_NOT_FOUND; @@ -525,6 +527,8 @@ uchar *propIDToName(propid_t propID) return UCHAR_CONSTANT("$MINUTE"); case PROP_SYS_MYHOSTNAME: return UCHAR_CONSTANT("$MYHOSTNAME"); + case PROP_SYS_BOM: + return UCHAR_CONSTANT("$BOM"); default: return UCHAR_CONSTANT("*invalid property id*"); } @@ -2427,6 +2431,12 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, case PROP_SYS_MYHOSTNAME: pRes = glbl.GetLocalHostName(); break; + case PROP_SYS_BOM: + if(*pbMustBeFreed == 1) + free(pRes); + pRes = (uchar*) "\xEF\xBB\xBF"; + *pbMustBeFreed = 0; + break; default: /* there is no point in continuing, we may even otherwise render the * error message unreadable. rgerhards, 2007-07-10 diff --git a/runtime/parser.c b/runtime/parser.c index d364497..b385c54 100644 --- a/runtime/parser.c +++ b/runtime/parser.c @@ -453,10 +453,10 @@ ParsePRI(msg_t *pMsg) if(pri & ~(LOG_FACMASK|LOG_PRIMASK)) pri = DEFUPRI; } + pMsg->iFacility = LOG_FAC(pri); + pMsg->iSeverity = LOG_PRI(pri); + MsgSetAfterPRIOffs(pMsg, msg - pMsg->pszRawMsg); } - pMsg->iFacility = LOG_FAC(pri); - pMsg->iSeverity = LOG_PRI(pri); - MsgSetAfterPRIOffs(pMsg, msg - pMsg->pszRawMsg); RETiRet; } diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index 78e61bc..d63dbe4 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -137,6 +137,7 @@ typedef uintTiny propid_t; #define PROP_SYS_QHOUR 156 #define PROP_SYS_MINUTE 157 #define PROP_SYS_MYHOSTNAME 158 +#define PROP_SYS_BOM 159 /* The error codes below are orginally "borrowed" from |