summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-12-12 11:53:05 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-12-12 11:53:05 +0000
commit63e31963e2de2062299ae429782422cc88fb5027 (patch)
tree946d778c6e2d7878fe5ac8a8aec1326c5532e11e
parent26121fcb315b13c9cf06132d4a8cdff0300ff2ea (diff)
downloadrsyslog-63e31963e2de2062299ae429782422cc88fb5027.tar.gz
rsyslog-63e31963e2de2062299ae429782422cc88fb5027.tar.xz
rsyslog-63e31963e2de2062299ae429782422cc88fb5027.zip
some cleanup (very minor)
-rw-r--r--msg.c4
-rw-r--r--syslogd.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/msg.c b/msg.c
index d9128478..5b211b8a 100644
--- a/msg.c
+++ b/msg.c
@@ -1190,7 +1190,7 @@ void MsgSetMSG(msg_t *pMsg, char* pszMSG)
free(pMsg->pszMSG);
pMsg->iLenMSG = strlen(pszMSG);
- if((pMsg->pszMSG = malloc(pMsg->iLenMSG + 1)) != NULL)
+ if((pMsg->pszMSG = (uchar*) malloc(pMsg->iLenMSG + 1)) != NULL)
memcpy(pMsg->pszMSG, pszMSG, pMsg->iLenMSG + 1);
else
dbgprintf("MsgSetMSG could not allocate memory for pszMSG buffer.");
@@ -1205,7 +1205,7 @@ void MsgSetRawMsg(msg_t *pMsg, char* pszRawMsg)
free(pMsg->pszRawMsg);
pMsg->iLenRawMsg = strlen(pszRawMsg);
- if((pMsg->pszRawMsg = malloc(pMsg->iLenRawMsg + 1)) != NULL)
+ if((pMsg->pszRawMsg = (uchar*) malloc(pMsg->iLenRawMsg + 1)) != NULL)
memcpy(pMsg->pszRawMsg, pszRawMsg, pMsg->iLenRawMsg + 1);
else
dbgprintf("Could not allocate memory for pszRawMsg buffer.");
diff --git a/syslogd.c b/syslogd.c
index 3abb77e4..e9e822eb 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2476,6 +2476,7 @@ static rsRetVal callAction(msg_t *pMsg, action_t *pAction)
dbgprintf("msg repeated %d times, %ld sec of %d.\n",
pAction->f_prevcount, time(NULL) - pAction->f_time,
repeatinterval[pAction->f_repeatcount]);
+ /* use current message, so we have the new timestamp (means we need to discard previous one) */
MsgDestruct(pAction->f_pMsg);
pAction->f_pMsg = MsgAddRef(pMsg);
/* If domark would have logged this by now, flush it now (so we don't hold
@@ -3469,7 +3470,10 @@ domark(void)
MarkSeq = 0;
}
- /* see if we need to flush any "message repeated n times"... */
+ /* see if we need to flush any "message repeated n times"...
+ * Note that this interferes with objects running on another thread.
+ * We are using appropriate locking inside the function to handle that.
+ */
for (f = Files; f != NULL ; f = f->f_next) {
llExecFunc(&f->llActList, domarkActions, NULL);
}