diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-01-24 06:37:22 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-01-24 06:37:22 +0100 |
commit | 076a648d33ab61656955c487429c81571746764d (patch) | |
tree | f2ef315115a7f0f1eb07c2191f3cfb0694fb35e9 /runtime/msg.c | |
parent | 0d71694fb3cbff71d504769e0e70a58ebe5f9a0d (diff) | |
parent | 2cde5ec4769f203e59413f8152008c712913bbf0 (diff) | |
download | rsyslog-076a648d33ab61656955c487429c81571746764d.tar.gz rsyslog-076a648d33ab61656955c487429c81571746764d.tar.bz2 rsyslog-076a648d33ab61656955c487429c81571746764d.zip |
Merge branch 'master' into master-dns-props
Diffstat (limited to 'runtime/msg.c')
-rw-r--r-- | runtime/msg.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index 3ead8c93..86c2e68c 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. * @@ -2080,12 +2080,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; |