summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-30 14:43:14 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-30 14:43:14 +0000
commit35c02f54dc057fd2ecdfa9397530d34c4fb0e916 (patch)
treea58fceba899347a88fe27febc115a93669435aff
parentb2f49fd163eefb4cc1bcd36cd367e5cf4a5713a9 (diff)
downloadrsyslog-35c02f54dc057fd2ecdfa9397530d34c4fb0e916.tar.gz
rsyslog-35c02f54dc057fd2ecdfa9397530d34c4fb0e916.tar.xz
rsyslog-35c02f54dc057fd2ecdfa9397530d34c4fb0e916.zip
fixed a bug that caused a potential hang in file and fwd output module
varmojfekoj provided the patch - many thanks!
-rw-r--r--ChangeLog2
-rw-r--r--omfile.c2
-rw-r--r--omfwd.c5
3 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a31980a2..f3454bac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,8 @@ Version 3.11.0 (rgerhards), 2008-01-??
- changed the ommysql output plugin so that the (lengthy) connection
initialization now takes place in message processing. This works much
better with the new queued action mode (fast startup)
+- fixed a bug that caused a potential hang in file and fwd output module
+ varmojfekoj provided the patch - many thanks!
---------------------------------------------------------------------------
Version 3.10.3 (rgerhards), 2008-01-28
- fixed a bug with standard template definitions (not a big deal) - thanks
diff --git a/omfile.c b/omfile.c
index 36627574..1fa96c6c 100644
--- a/omfile.c
+++ b/omfile.c
@@ -361,6 +361,7 @@ static void prepareFile(instanceData *pData, uchar *newFileName)
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
@@ -602,6 +603,7 @@ finalize_it:
BEGINcreateInstance
CODESTARTcreateInstance
+ pData->fd = -1;
ENDcreateInstance
diff --git a/omfwd.c b/omfwd.c
index d63ae1bf..94fdfa04 100644
--- a/omfwd.c
+++ b/omfwd.c
@@ -120,6 +120,7 @@ char *getFwdSyslogPt(instanceData *pData)
BEGINcreateInstance
CODESTARTcreateInstance
+ pData->sock = -1;
ENDcreateInstance
@@ -269,8 +270,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;
}