summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-10-06 12:07:53 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-10-06 12:07:53 +0200
commitb849df20045ca5dfec36cdff5641e8a78d326b49 (patch)
tree7c518f7679e19ef498e81f1b7fcfea553bb67717 /runtime
parent1e53745dc9f11a90c613d177b2caba563c2b83be (diff)
parent39000a62024510cd62607200e6100e3cd7c05005 (diff)
downloadrsyslog-b849df20045ca5dfec36cdff5641e8a78d326b49.tar.gz
rsyslog-b849df20045ca5dfec36cdff5641e8a78d326b49.tar.xz
rsyslog-b849df20045ca5dfec36cdff5641e8a78d326b49.zip
Merge branch 'master' into perf
Conflicts: ChangeLog
Diffstat (limited to 'runtime')
-rw-r--r--runtime/datetime.c2
-rw-r--r--runtime/msg.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/runtime/datetime.c b/runtime/datetime.c
index 47cde8c2..20ca6191 100644
--- a/runtime/datetime.c
+++ b/runtime/datetime.c
@@ -582,7 +582,7 @@ int formatTimestampSecFrac(struct syslogTime *ts, char* pBuf, size_t iLenBuf)
lenRet = snprintf(pBuf, iLenBuf, szFmtStr, ts->secfrac);
} else {
pBuf[0] = '0';
- pBuf[1] = '1';
+ pBuf[1] = '\0';
lenRet = 1;
}
diff --git a/runtime/msg.c b/runtime/msg.c
index ac387354..69296710 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -257,7 +257,16 @@ rsRetVal msgConstruct(msg_t **ppThis)
pM->iRefCount = 1;
pM->iSeverity = -1;
pM->iFacility = -1;
+
+ /* we initialize both timestamps to contain the current time, so that they
+ * are consistent. Also, this saves us from doing any further time calls just
+ * to obtain a timestamp. The memcpy() should not really make a difference,
+ * especially as I think there is no codepath currently where it would not be
+ * required (after I have cleaned up the pathes ;)). -- rgerhards, 2008-10-02
+ */
datetime.getCurrTime(&(pM->tRcvdAt));
+ memcpy(&pM->tTIMESTAMP, &pM->tRcvdAt, sizeof(struct syslogTime));
+
objConstructSetObjInfo(pM);
/* DEV debugging only! dbgprintf("msgConstruct\t0x%x, ref 1\n", (int)pM);*/