summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-11-23 17:44:58 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-11-23 17:44:58 +0000
commit193a639b2481eba4a6b881a53ac3ff6c5faab410 (patch)
treefa369270fe3560fb9005e61e0d4013f1b85eef23
parent46be94a0ae4af704b1a1b04007724a28d1b37fbb (diff)
downloadrsyslog-193a639b2481eba4a6b881a53ac3ff6c5faab410.tar.gz
rsyslog-193a639b2481eba4a6b881a53ac3ff6c5faab410.tar.xz
rsyslog-193a639b2481eba4a6b881a53ac3ff6c5faab410.zip
fixed a bug in RFC3339 timestamp generation; added support for 3339
timestamps in internally-generated messages
-rw-r--r--NEWS4
-rw-r--r--syslogd.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 85360a11..bfc8af1f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
---------------------------------------------------------------------------
Version 1.12.2 (RGer), 2005-11-??
+- fixed a bug in the RFC 3339 date formater. An extra space was added
+ after the actual timestamp
+- added support for providing high-precision RFC3339 timestamps for
+ (rsyslogd-)internally-generated messages
---------------------------------------------------------------------------
Version 1.12.1 (RGer), 2005-11-23
- made multithreading work with BSD. Some signal-handling needed to be
diff --git a/syslogd.c b/syslogd.c
index 9a8221d9..cf9871f9 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -1838,7 +1838,7 @@ static int formatTimestamp3339(struct syslogTime *ts, char* pBuf, size_t iLenBuf
char szFmtStr[64];
/* be careful: there is ONE actual %d in the format string below ;) */
snprintf(szFmtStr, sizeof(szFmtStr),
- "%%04d-%%02d-%%02dT%%02d:%%02d:%%02d.%%0%dd%%c%%02d:%%02d ",
+ "%%04d-%%02d-%%02dT%%02d:%%02d:%%02d.%%0%dd%%c%%02d:%%02d",
ts->secfracPrecision);
iRet = snprintf(pBuf, iLenBuf, szFmtStr, ts->year, ts->month, ts->day,
ts->hour, ts->minute, ts->second, ts->secfrac,
@@ -1846,7 +1846,7 @@ static int formatTimestamp3339(struct syslogTime *ts, char* pBuf, size_t iLenBuf
}
else
iRet = snprintf(pBuf, iLenBuf,
- "%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d%c%2.2d:%2.2d ",
+ "%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d%c%2.2d:%2.2d",
ts->year, ts->month, ts->day,
ts->hour, ts->minute, ts->second,
ts->OffsetMode, ts->OffsetHour, ts->OffsetMinute);
@@ -3730,10 +3730,6 @@ void logmsg(int pri, struct msg *pMsg, int flags)
(void) time(&now);
if (flags & ADDDATE) {
getCurrTime(&(pMsg->tTIMESTAMP)); /* use the current time! */
- /* but modify it to be an RFC 3164 time... */
- pMsg->tTIMESTAMP.timeType = 1;
- pMsg->tTIMESTAMP.secfracPrecision = 0;
- pMsg->tTIMESTAMP.secfrac = 0;
}
/* parse HOSTNAME - but only if this is network-received!