summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2012-10-16 16:44:03 +0200
committerMichael Biebl <biebl@debian.org>2012-10-16 16:44:03 +0200
commit1fc4db11217caa3faebbfde8bd310fb64c9f860c (patch)
tree39fca9174460f0a55e46b67793dea0c35e537ac0 /runtime
parent64b89c604c6cec4fd0de51f2776f95b34e388bae (diff)
downloadrsyslog-1fc4db11217caa3faebbfde8bd310fb64c9f860c.tar.gz
Imported Upstream version 7.1.11upstream/7.1.11
Diffstat (limited to 'runtime')
-rw-r--r--runtime/msg.c13
-rw-r--r--runtime/rsyslog.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index d3c814e..d874178 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -2698,6 +2698,7 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
uchar *pBuf;
int iLen;
short iOffs;
+ enum tplFormatTypes datefmt;
BEGINfunc
assert(pMsg != NULL);
@@ -2717,7 +2718,11 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
bufLen = getMSGLen(pMsg);
break;
case PROP_TIMESTAMP:
- pRes = (uchar*)getTimeReported(pMsg, pTpe->data.field.eDateFormat);
+ if (pTpe != NULL)
+ datefmt = pTpe->data.field.eDateFormat;
+ else
+ datefmt = tplFmtDefault;
+ pRes = (uchar*)getTimeReported(pMsg, datefmt);
break;
case PROP_HOSTNAME:
pRes = (uchar*)getHOSTNAME(pMsg);
@@ -2767,7 +2772,11 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
pRes = (uchar*)getSeverityStr(pMsg);
break;
case PROP_TIMEGENERATED:
- pRes = (uchar*)getTimeGenerated(pMsg, pTpe->data.field.eDateFormat);
+ if (pTpe != NULL)
+ datefmt = pTpe->data.field.eDateFormat;
+ else
+ datefmt = tplFmtDefault;
+ pRes = (uchar*)getTimeGenerated(pMsg, datefmt);
break;
case PROP_PROGRAMNAME:
pRes = getProgramName(pMsg, LOCK_MUTEX);
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 4404c47..07d58d6 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -392,6 +392,7 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_JNAME_NOTFOUND = -2305, /**< JSON name not found (does not exist) */
RS_RET_INVLD_SETOP = -2305, /**< invalid variable set operation, incompatible type */
RS_RET_RULESET_EXISTS = -2306,/**< ruleset already exists */
+ RS_RET_DEPRECATED = -2307,/**< deprecated functionality is used */
/* RainerScript error messages (range 1000.. 1999) */
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */