summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
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);*/