summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-11-12 17:12:10 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2009-11-12 17:12:10 +0100
commit8b246de2a587454f9260ff91192d27a2e168ea2d (patch)
treeeaf442ec207ba1f626119be4f983c69c9c2b5ba3 /tools
parent6b722a09d419ad2a552710260bb8e220858f17c2 (diff)
downloadrsyslog-8b246de2a587454f9260ff91192d27a2e168ea2d.tar.gz
rsyslog-8b246de2a587454f9260ff91192d27a2e168ea2d.tar.xz
rsyslog-8b246de2a587454f9260ff91192d27a2e168ea2d.zip
some light performance enhancement
...by replacing time() call with much faster (at least under linux) gettimeofday() calls.
Diffstat (limited to 'tools')
-rw-r--r--tools/syslogd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index a8cba185..820cf273 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -706,7 +706,7 @@ DEFFUNC_llExecFunc(flushRptdMsgsActions)
* the beginn of the llExec(). This makes it slightly less correct, but
* in an acceptable way. -- rgerhards, 2008-09-16
*/
- if (pAction->f_prevcount && time(NULL) >= REPEATTIME(pAction)) {
+ if (pAction->f_prevcount && datetime.GetTime(NULL) >= REPEATTIME(pAction)) {
DBGPRINTF("flush %s: repeated %d times, %d sec.\n",
module.GetStateName(pAction->pMod), pAction->f_prevcount,
repeatinterval[pAction->f_repeatcount]);
@@ -735,7 +735,7 @@ static void debug_switch()
struct tm tp;
struct sigaction sigAct;
- time(&tTime);
+ datetime.GetTime(&tTime);
localtime_r(&tTime, &tp);
if(debugging_on == 0) {
debugging_on = 1;