summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-01-24 06:36:42 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-01-24 06:36:42 +0100
commit2cde5ec4769f203e59413f8152008c712913bbf0 (patch)
tree7e043ce9303ad251c8e76893580ac0c9f35e2ab2
parent6b4d9afccb4297face53fd6bec0fb30b6a8da1c3 (diff)
downloadrsyslog-2cde5ec4769f203e59413f8152008c712913bbf0.tar.gz
rsyslog-2cde5ec4769f203e59413f8152008c712913bbf0.tar.bz2
rsyslog-2cde5ec4769f203e59413f8152008c712913bbf0.zip
regression fix: programname was not properly handled
Regression from recent refactoring - never released.
-rw-r--r--runtime/msg.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 0b9e9665..98600cdd 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -7,7 +7,7 @@
* of the "old" message code without any modifications. However, it
* helps to have things at the right place one we go to the meat of it.
*
- * Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2007-2013 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of the rsyslog runtime library.
*
@@ -2084,12 +2084,16 @@ static inline char *getStructuredData(msg_t *pM)
*/
uchar *getProgramName(msg_t *pM, sbool bLockMutex)
{
- if(pM->iLenPROGNAME == -1 && bLockMutex == LOCK_MUTEX) {
- MsgLock(pM);
- /* need to re-check, things may have change in between! */
- if(pM->iLenPROGNAME == -1)
+ if(pM->iLenPROGNAME == -1) {
+ if(bLockMutex == LOCK_MUTEX) {
+ MsgLock(pM);
+ /* need to re-check, things may have change in between! */
+ if(pM->iLenPROGNAME == -1)
+ aquireProgramName(pM);
+ MsgUnlock(pM);
+ } else {
aquireProgramName(pM);
- MsgUnlock(pM);
+ }
}
return (pM->iLenPROGNAME < CONF_PROGNAME_BUFSIZE) ? pM->PROGNAME.szBuf
: pM->PROGNAME.ptr;