Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Update
rsyslog
rsyslog-flush-dyn-file.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File rsyslog-flush-dyn-file.patch of Package rsyslog
Index: rsyslog-8.24.0/tools/omfile.c =================================================================== --- rsyslog-8.24.0.orig/tools/omfile.c +++ rsyslog-8.24.0/tools/omfile.c @@ -1040,10 +1040,28 @@ BEGINcommitTransaction instanceData *__restrict__ const pData = pWrkrData->pData; unsigned i; CODESTARTcommitTransaction + strm_t *lastStream = NULL; + pthread_mutex_lock(&pData->mutWrite); for(i = 0 ; i < nParams ; ++i) { writeFile(pData, pParams, i); + + /* If prepareDynFile() is called inside writeFile(), + * it could switch pData->pStrm in batch mode. When + * this happens, make sure we flush the old pStrm + * because the last flush will not cover it. + * Note, I'm not sure about the life cycle of these + * strm_t (they seem to be managed ins pCache[]), if + * lastStream points to a free'd memory, I'm screwed. + */ + if(pData->bDynamicName && + pData->bFlushOnTXEnd && !pData->bUseAsyncWriter && + lastStream != NULL && pData->pStrm != lastStream) { + CHKiRet(strm.Flush(lastStream)); + } + + lastStream = pData->pStrm; } /* Note: pStrm may be NULL if there was an error opening the stream */ if(pData->bUseAsyncWriter) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor