summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-24 07:27:08 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-24 07:27:08 +0000
commit5abc990a6a2178bbc730a43bd0ee9b433abc8303 (patch)
treea8e37e44bd6aeb4f7009be3d67314008a453e9cb
parent3b176b63e167c0d3ca0aefdd549b667bd863a1f0 (diff)
downloadrsyslog-5abc990a6a2178bbc730a43bd0ee9b433abc8303.tar.gz
rsyslog-5abc990a6a2178bbc730a43bd0ee9b433abc8303.tar.xz
rsyslog-5abc990a6a2178bbc730a43bd0ee9b433abc8303.zip
fixed a bug that caused a potential hang in file and fwd output module
varmojfekoj provided the patch - many thanks!
-rw-r--r--ChangeLog4
-rw-r--r--omfile.c2
-rw-r--r--omfwd.c5
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c8c0558f..1a28dbc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,11 @@
---------------------------------------------------------------------------
-Version 2.0.1 STABLE (rgerhards), 2008-01-??
+Version 2.0.1 STABLE (rgerhards), 2008-01-24
- fixed a bug in integer conversion - but this function was never called,
so it is not really a useful bug fix ;)
- fixed a bug with standard template definitions (not a big deal) - thanks
to varmojfekoj for spotting it
+- fixed a bug that caused a potential hang in file and fwd output module
+ varmojfekoj provided the patch - many thanks!
---------------------------------------------------------------------------
Version 2.0.0 STABLE (rgerhards), 2008-01-02
- re-release of 1.21.2 as STABLE with no modifications except some
diff --git a/omfile.c b/omfile.c
index 3691d981..cd5e23c4 100644
--- a/omfile.c
+++ b/omfile.c
@@ -357,6 +357,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
@@ -596,6 +597,7 @@ again:
BEGINcreateInstance
CODESTARTcreateInstance
+ pData->fd = -1;
ENDcreateInstance
diff --git a/omfwd.c b/omfwd.c
index f01e0459..9b56acd5 100644
--- a/omfwd.c
+++ b/omfwd.c
@@ -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;
}