summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
authorvarmojfekoj <theinric@redhat.com>2008-09-01 16:00:22 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-09-01 16:00:22 +0200
commit6cbc5652ddee825899d1126ddef51f6f8bfa6467 (patch)
tree3984808a0a74772efcc9d6e00b8668d5e1257852 /action.c
parent3f2856b4b5010dfcaa720b292dc3a655e7b9f6da (diff)
downloadrsyslog-6cbc5652ddee825899d1126ddef51f6f8bfa6467.tar.gz
rsyslog-6cbc5652ddee825899d1126ddef51f6f8bfa6467.tar.xz
rsyslog-6cbc5652ddee825899d1126ddef51f6f8bfa6467.zip
bugfix: action was not called when system time was set backwards
(until the previous time was reached again). There are still some side-effects when time is rolled back (A time rollback is really a bad thing to do, ideally the OS should issue pseudo time (like NetWare did) when the user tries to roll back time). Signed-off-by: Rainer Gerhards <rgerhards@adiscon.com>
Diffstat (limited to 'action.c')
-rw-r--r--action.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/action.c b/action.c
index 39c37b5b..8b47f541 100644
--- a/action.c
+++ b/action.c
@@ -544,6 +544,10 @@ actionWriteToAction(action_t *pAction)
dbgprintf("Called action, logging to %s", module.GetStateName(pAction->pMod));
time(&now); /* we need this for message repeation processing AND $ActionExecOnlyOnceEveryInterval */
+ if(pAction->tLastExec > now) {
+ /* if we are traveling back in time, reset tLastExec */
+ pAction->tLastExec = (time_t) 0;
+ }
/* now check if we need to drop the message because otherwise the action would be too
* frequently called. -- rgerhards, 2008-04-08
*/