diff -up rsyslog-2.0.0/omfwd.c.hang rsyslog-2.0.0/omfwd.c --- rsyslog-2.0.0/omfwd.c.hang 2008-01-17 12:24:03.000000000 +0100 +++ rsyslog-2.0.0/omfwd.c 2008-01-17 13:34:37.000000000 +0100 @@ -116,6 +116,7 @@ typedef struct _instanceData { BEGINcreateInstance CODESTARTcreateInstance + pData->sock = -1; ENDcreateInstance @@ -278,8 +279,8 @@ static rsRetVal TCPSendInit(void *pvData instanceData *pData = (instanceData *) pvData; assert(pData != NULL); - if(pData->sock <= 0) { - if((pData->sock = TCPSendCreateSocket(pData->f_addr)) <= 0) + if(pData->sock < 0) { + if((pData->sock = TCPSendCreateSocket(pData->f_addr)) < 0) iRet = RS_RET_TCP_SOCKCREATE_ERR; } diff -up rsyslog-2.0.0/omfile.c.hang rsyslog-2.0.0/omfile.c --- rsyslog-2.0.0/omfile.c.hang 2008-01-17 12:24:11.000000000 +0100 +++ rsyslog-2.0.0/omfile.c 2008-01-17 13:16:57.000000000 +0100 @@ -357,6 +357,7 @@ static void prepareFile(instanceData *pD pData->fd = open((char*) newFileName, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY, pData->fCreateMode); } else { + pData->fd = -1; /* file does not exist, create it (and eventually parent directories */ if(pData->bCreateDirs) { /* we fist need to create parent dirs if they are missing @@ -596,6 +597,7 @@ again: BEGINcreateInstance CODESTARTcreateInstance + pData->fd = -1; ENDcreateInstance diff -up rsyslog-2.0.0/tcpsyslog.c.hang rsyslog-2.0.0/tcpsyslog.c