On 11/15/2010 03:54 PM, Dražen Kačar wrote:
Configuration option would be perfect for my purposes. I'd just need a
patch unless you intend to release a new version in the next few days.

I have attached a patch that *could* work. Unfortunately, I currently do not have the time to really test it out. So I'd appreciate if you could give it a try and report back your results.

As a unrelated side-note, I have set up CentOS 5.5 in a VM and tried to compile rsyslog from git there. The autotools version seems to be very old. Is there any way to get 2.61 on that platform without building from source (I want to be as close to a standard system as possible and so I'd like not to build too many different things...).

Rainer
diff --git a/tools/ompipe.c b/tools/ompipe.c
index c51a5c4..d8a56c8 100644
--- a/tools/ompipe.c
+++ b/tools/ompipe.c
@@ -65,12 +65,14 @@ DEFobjCurrIf(errmsg)
 
 
 /* globals for default values */
+static int bBlocking = 0;
 /* end globals for default values */
 
 
 typedef struct _instanceData {
        uchar   f_fname[MAXFNAME];/* pipe or template name (display only) */
        short   fd;               /* pipe descriptor for (current) pipe */
+       sbool   bBlocking;
 } instanceData;
 
 
@@ -98,7 +100,12 @@ ENDdbgPrintInstInfo
 static inline rsRetVal
 preparePipe(instanceData *pData)
 {
+       unsigned mode;
+
        DEFiRet;
+       mode = O_RDWR|O_CLOEXEC;
+       if(pData->bBlocking)
+               mode |= O_NONBLOCK;
        pData->fd = open((char*) pData->f_fname, O_RDWR|O_NONBLOCK|O_CLOEXEC);
        RETiRet;
 }
@@ -197,6 +204,8 @@ CODESTARTparseSelectorAct
         */
        CHKiRet(cflineParseFileName(p, (uchar*) pData->f_fname, *ppOMSR, 0, 
OMSR_NO_RQD_TPL_OPTS,
                                       (pszFileDfltTplName == NULL) ? 
(uchar*)"RSYSLOG_FileFormat" : pszFileDfltTplName));
+       pData->bBlocking = bBlocking;
+       bBlocking = 0;
 
        /* at this stage, we ignore the return value of preparePipe, this is 
taken
         * care of in later steps. -- rgerhards, 2009-03-19
@@ -237,6 +246,7 @@ BEGINmodInit(Pipe)
 CODESTARTmodInit
        *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current 
interface specification */
 CODEmodInit_QueryRegCFSLineHdlr
+       CHKiRet(omsdRegCFSLineHdlr((uchar *)"ompipeblockingmode", 0, 
eCmdHdlrBinary, NULL, &bBlocking, STD_LOADABLE_MODULE_ID));
        CHKiRet(objUse(errmsg, CORE_COMPONENT));
 ENDmodInit
 /* vi:set ai:
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to