diff options
author | Michael Biebl <biebl@debian.org> | 2014-05-16 14:51:51 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2014-05-16 14:51:51 +0200 |
commit | f1040389ccb2430b9ab2ba3209aa28a62565b721 (patch) | |
tree | c6bf609292b6f3a80754c2d01cc8855a36ac7a37 /runtime | |
parent | 9374a46543e9c43c009f80def8c3b2506b0b377e (diff) | |
download | rsyslog-f1040389ccb2430b9ab2ba3209aa28a62565b721.tar.gz |
Imported Upstream version 8.2.1upstream/8.2.1
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/msg.c | 20 | ||||
-rw-r--r-- | runtime/msg.h | 14 | ||||
-rw-r--r-- | runtime/prop.c | 6 | ||||
-rw-r--r-- | runtime/prop.h | 6 | ||||
-rw-r--r-- | runtime/typedefs.h | 6 | ||||
-rw-r--r-- | runtime/unicode-helper.h | 2 |
6 files changed, 28 insertions, 26 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index 2959796..ded8cfe 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-2013 Rainer Gerhards and Adiscon GmbH. + * Copyright 2007-2014 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -1418,7 +1418,7 @@ static void msgSetUUID(msg_t * const pM) uuid_t uuid; static pthread_mutex_t mutUUID = PTHREAD_MUTEX_INITIALIZER; - dbgprintf("[MsgSetUUID] START\n"); + dbgprintf("[MsgSetUUID] START, lenRes %llu\n", (long long unsigned) lenRes); assert(pM != NULL); if((pM->pszUUID = (uchar*) MALLOC(lenRes)) == NULL) { @@ -1432,8 +1432,8 @@ static void msgSetUUID(msg_t * const pM) pM->pszUUID[byte_nbr * 2 + 1] = hex_char[uuid [byte_nbr] & 15]; } + pM->pszUUID[lenRes-1] = '\0'; dbgprintf("[MsgSetUUID] UUID : %s LEN: %d \n", pM->pszUUID, (int)lenRes); - pM->pszUUID[lenRes] = '\0'; } dbgprintf("[MsgSetUUID] END\n"); } @@ -1794,7 +1794,7 @@ MsgSetAfterPRIOffs(msg_t * const pMsg, short offs) * which already obtained the lock. So in general, this function here must * only be called when it it safe to do so without it aquiring a lock. */ -rsRetVal MsgSetAPPNAME(msg_t * const pMsg, char* pszAPPNAME) +rsRetVal MsgSetAPPNAME(msg_t *__restrict__ const pMsg, const char* pszAPPNAME) { DEFiRet; assert(pMsg != NULL); @@ -1812,7 +1812,7 @@ finalize_it: /* rgerhards 2004-11-24: set PROCID in msg object */ -rsRetVal MsgSetPROCID(msg_t * const pMsg, char* pszPROCID) +rsRetVal MsgSetPROCID(msg_t *__restrict__ const pMsg, const char* pszPROCID) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); @@ -1881,7 +1881,7 @@ char *getPROCID(msg_t * const pM, sbool bLockMutex) /* rgerhards 2004-11-24: set MSGID in msg object */ -rsRetVal MsgSetMSGID(msg_t * const pMsg, char* pszMSGID) +rsRetVal MsgSetMSGID(msg_t * const pMsg, const char* pszMSGID) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); @@ -1941,7 +1941,7 @@ void MsgSetRuleset(msg_t * const pMsg, ruleset_t *pRuleset) /* set TAG in msg object * (rewritten 2009-06-18 rgerhards) */ -void MsgSetTAG(msg_t * const pMsg, uchar* pszBuf, size_t lenBuf) +void MsgSetTAG(msg_t *__restrict__ const pMsg, const uchar* pszBuf, const size_t lenBuf) { uchar *pBuf; assert(pMsg != NULL); @@ -2084,7 +2084,7 @@ uchar *getRcvFrom(msg_t * const pM) /* rgerhards 2004-11-24: set STRUCTURED DATA in msg object */ -rsRetVal MsgSetStructuredData(msg_t * const pMsg, char* pszStrucData) +rsRetVal MsgSetStructuredData(msg_t * const pMsg, const char* pszStrucData) { DEFiRet; ISOBJ_TYPE_assert(pMsg, msg); @@ -2264,7 +2264,7 @@ void MsgSetRcvFrom(msg_t *pThis, prop_t *new) * name (but it works only for the immediate previous). * rgerhards, 2009-06-31 */ -void MsgSetRcvFromStr(msg_t *pThis, uchar *psz, int len, prop_t **ppProp) +void MsgSetRcvFromStr(msg_t * const pThis, const uchar *psz, const int len, prop_t **ppProp) { assert(pThis != NULL); assert(ppProp != NULL); @@ -2299,7 +2299,7 @@ rsRetVal MsgSetRcvFromIP(msg_t *pThis, prop_t *new) * name (but it works only for the immediate previous). * rgerhards, 2009-06-31 */ -rsRetVal MsgSetRcvFromIPStr(msg_t *pThis, uchar *psz, int len, prop_t **ppProp) +rsRetVal MsgSetRcvFromIPStr(msg_t *const pThis, const uchar *psz, const int len, prop_t **ppProp) { DEFiRet; assert(pThis != NULL); diff --git a/runtime/msg.h b/runtime/msg.h index a2392a2..2d3e995 100644 --- a/runtime/msg.h +++ b/runtime/msg.h @@ -162,21 +162,21 @@ msg_t *MsgAddRef(msg_t *pM); void setProtocolVersion(msg_t *pM, int iNewVersion); void MsgSetInputName(msg_t *pMsg, prop_t*); void MsgSetDfltTZ(msg_t *pThis, char *tz); -rsRetVal MsgSetAPPNAME(msg_t *pMsg, char* pszAPPNAME); -rsRetVal MsgSetPROCID(msg_t *pMsg, char* pszPROCID); -rsRetVal MsgSetMSGID(msg_t *pMsg, char* pszMSGID); +rsRetVal MsgSetAPPNAME(msg_t *pMsg, const char* pszAPPNAME); +rsRetVal MsgSetPROCID(msg_t *pMsg, const char* pszPROCID); +rsRetVal MsgSetMSGID(msg_t *pMsg, const char* pszMSGID); void MsgSetParseSuccess(msg_t *pMsg, int bSuccess); -void MsgSetTAG(msg_t *pMsg, uchar* pszBuf, size_t lenBuf); +void MsgSetTAG(msg_t *pMsg, const uchar* pszBuf, const size_t lenBuf); void MsgSetRuleset(msg_t *pMsg, ruleset_t*); rsRetVal MsgSetFlowControlType(msg_t *pMsg, flowControl_t eFlowCtl); -rsRetVal MsgSetStructuredData(msg_t *pMsg, char* pszStrucData); +rsRetVal MsgSetStructuredData(msg_t *const pMsg, const char* pszStrucData); rsRetVal MsgAddToStructuredData(msg_t *pMsg, uchar *toadd, rs_size_t len); void MsgGetStructuredData(msg_t *pM, uchar **pBuf, rs_size_t *len); rsRetVal msgSetFromSockinfo(msg_t *pThis, struct sockaddr_storage *sa); void MsgSetRcvFrom(msg_t *pMsg, prop_t*); -void MsgSetRcvFromStr(msg_t *pMsg, uchar* pszRcvFrom, int, prop_t **); +void MsgSetRcvFromStr(msg_t *const pMsg, const uchar* pszRcvFrom, const int, prop_t **); rsRetVal MsgSetRcvFromIP(msg_t *pMsg, prop_t*); -rsRetVal MsgSetRcvFromIPStr(msg_t *pThis, uchar *psz, int len, prop_t **ppProp); +rsRetVal MsgSetRcvFromIPStr(msg_t *const pThis, const uchar *psz, const int len, prop_t **ppProp); void MsgSetHOSTNAME(msg_t *pMsg, uchar* pszHOSTNAME, int lenHOSTNAME); rsRetVal MsgSetAfterPRIOffs(msg_t *pMsg, short offs); void MsgSetMSGoffs(msg_t *pMsg, short offs); diff --git a/runtime/prop.c b/runtime/prop.c index cb89fac..fa067bd 100644 --- a/runtime/prop.c +++ b/runtime/prop.c @@ -73,7 +73,7 @@ ENDobjDestruct(prop) /* set string, we make our own private copy! This MUST only be called BEFORE * ConstructFinalize()! */ -static rsRetVal SetString(prop_t *pThis, uchar *psz, int len) +static rsRetVal SetString(prop_t *pThis, const uchar *psz, const int len) { DEFiRet; ISOBJ_TYPE_assert(pThis, prop); @@ -142,7 +142,7 @@ static rsRetVal AddRef(prop_t *pThis) * convenience, it is alos (very, very) slightly faster. * rgerhards, 2009-07-01 */ -static rsRetVal CreateStringProp(prop_t **ppThis, uchar* psz, int len) +static rsRetVal CreateStringProp(prop_t **ppThis, const uchar* psz, const int len) { DEFiRet; propConstruct(ppThis); @@ -161,7 +161,7 @@ static rsRetVal CreateStringProp(prop_t **ppThis, uchar* psz, int len) * existing property). * rgerhards, 2009-07-01 */ -rsRetVal CreateOrReuseStringProp(prop_t **ppThis, uchar *psz, int len) +rsRetVal CreateOrReuseStringProp(prop_t **ppThis, const uchar *psz, const int len) { uchar *pszPrev; int lenPrev; diff --git a/runtime/prop.h b/runtime/prop.h index c7564e6..7cb2743 100644 --- a/runtime/prop.h +++ b/runtime/prop.h @@ -42,12 +42,12 @@ BEGINinterface(prop) /* name must also be changed in ENDinterface macro! */ rsRetVal (*Construct)(prop_t **ppThis); rsRetVal (*ConstructFinalize)(prop_t *pThis); rsRetVal (*Destruct)(prop_t **ppThis); - rsRetVal (*SetString)(prop_t *pThis, uchar* psz, int len); + rsRetVal (*SetString)(prop_t *pThis, const uchar* psz, const int len); rsRetVal (*GetString)(prop_t *pThis, uchar** ppsz, int *plen); int (*GetStringLen)(prop_t *pThis); rsRetVal (*AddRef)(prop_t *pThis); - rsRetVal (*CreateStringProp)(prop_t **ppThis, uchar* psz, int len); - rsRetVal (*CreateOrReuseStringProp)(prop_t **ppThis, uchar *psz, int len); + rsRetVal (*CreateStringProp)(prop_t **ppThis, const uchar* psz, const int len); + rsRetVal (*CreateOrReuseStringProp)(prop_t **ppThis, const uchar *psz, const int len); ENDinterface(prop) #define propCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ diff --git a/runtime/typedefs.h b/runtime/typedefs.h index 8d206f6..d604538 100644 --- a/runtime/typedefs.h +++ b/runtime/typedefs.h @@ -3,7 +3,7 @@ * * Begun 2010-11-25 RGerhards * - * Copyright (C) 2005-2013 by Rainer Gerhards and Adiscon GmbH + * Copyright (C) 2005-2014 by Rainer Gerhards and Adiscon GmbH * * This file is part of the rsyslog runtime library. * @@ -158,7 +158,9 @@ typedef enum { } fiop_t; #ifndef HAVE_LSEEK64 - typedef off_t off64_t; +# ifndef HAVE_OFF64_T + typedef off_t off64_t; +# endif #endif diff --git a/runtime/unicode-helper.h b/runtime/unicode-helper.h index ed06d24..6337701 100644 --- a/runtime/unicode-helper.h +++ b/runtime/unicode-helper.h @@ -50,7 +50,7 @@ static inline int ustrcmp(const uchar *psz1, const uchar *psz2) { - return strcmp((char*) psz1, (char*) psz2); + return strcmp((const char*) psz1, (const char*) psz2); } static inline int ustrlen(const uchar *psz) |