diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-05-21 04:29:53 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-05-21 04:29:53 +0200 |
commit | 780e2d37e4d27f040d15e09b25542d6808a19436 (patch) | |
tree | ed63ad693d64961c3db56a423827e83e9760b156 /runtime | |
parent | 503dec99f2e21fba336c989b209fadbf201e6f7e (diff) | |
parent | 715b9fe052f5a7c622a1f71f905461e06e398de8 (diff) | |
download | rsyslog-780e2d37e4d27f040d15e09b25542d6808a19436.tar.gz rsyslog-780e2d37e4d27f040d15e09b25542d6808a19436.tar.xz rsyslog-780e2d37e4d27f040d15e09b25542d6808a19436.zip |
Merge branch 'beta'
Conflicts:
ChangeLog
plugins/imrelp/imrelp.c
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/glbl.c | 6 | ||||
-rw-r--r-- | runtime/queue.c | 6 | ||||
-rw-r--r-- | runtime/stream.c | 11 |
3 files changed, 22 insertions, 1 deletions
diff --git a/runtime/glbl.c b/runtime/glbl.c index 0114b1ac..71901dee 100644 --- a/runtime/glbl.c +++ b/runtime/glbl.c @@ -188,6 +188,11 @@ GetLocalHostName(void) { uchar *pszRet; + if(LocalHostNameOverride != NULL) { + pszRet = LocalHostNameOverride; + goto done; + } + if(LocalHostName == NULL) pszRet = (uchar*) "[localhost]"; else { @@ -196,6 +201,7 @@ GetLocalHostName(void) else pszRet = LocalHostName; } +done: return(pszRet); } diff --git a/runtime/queue.c b/runtime/queue.c index 50ae307c..88e01a7a 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -2279,6 +2279,7 @@ doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr) objDestruct(pUsr); ABORT_FINALIZE(RS_RET_QUEUE_FULL); } + dbgoprint((obj_t*) pThis, "enqueueMsg: wait solved queue full condition, enqueing\n"); } /* and finally enqueue the message */ @@ -2306,6 +2307,7 @@ qqueueMultiEnqObjNonDirect(qqueue_t *pThis, multi_submit_t *pMultiSub) { int iCancelStateSave; int i; + rsRetVal localRet; DEFiRet; ISOBJ_TYPE_assert(pThis, qqueue); @@ -2314,7 +2316,9 @@ qqueueMultiEnqObjNonDirect(qqueue_t *pThis, multi_submit_t *pMultiSub) pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); d_pthread_mutex_lock(pThis->mut); for(i = 0 ; i < pMultiSub->nElem ; ++i) { - CHKiRet(doEnqSingleObj(pThis, pMultiSub->ppMsgs[i]->flowCtlType, (void*)pMultiSub->ppMsgs[i])); + localRet = doEnqSingleObj(pThis, pMultiSub->ppMsgs[i]->flowCtlType, (void*)pMultiSub->ppMsgs[i]); + if(localRet != RS_RET_OK && localRet != RS_RET_QUEUE_FULL) + ABORT_FINALIZE(localRet); } qqueueChkPersist(pThis, pMultiSub->nElem); diff --git a/runtime/stream.c b/runtime/stream.c index 24dbcc09..ae716815 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -259,6 +259,7 @@ static rsRetVal strmOpenFile(strm_t *pThis) if(pThis->fd != -1) ABORT_FINALIZE(RS_RET_OK); + pThis->pszCurrFName = NULL; /* used to prevent mem leak in case of error */ if(pThis->pszFName == NULL) ABORT_FINALIZE(RS_RET_FILE_PREFIX_MISSING); @@ -290,6 +291,16 @@ static rsRetVal strmOpenFile(strm_t *pThis) (pThis->tOperationsMode == STREAMMODE_READ) ? "READ" : "WRITE", pThis->fd); finalize_it: + if(iRet != RS_RET_OK) { + if(pThis->pszCurrFName != NULL) { + free(pThis->pszCurrFName); + pThis->pszCurrFName = NULL; /* just to prevent mis-adressing down the road... */ + } + if(pThis->fd != -1) { + close(pThis->fd); + pThis->fd = -1; + } + } RETiRet; } |