diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-08-22 15:32:05 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-08-22 15:32:05 +0200 |
commit | 01fe0fd2ab8a19bdf61bda2256429726ba8e0b53 (patch) | |
tree | 22f2d50ae3f3d88ca2ec83f53dd9d6d2453b1817 /runtime/stream.c | |
parent | 9faf2240c4a8f09f3f6c2c9bbd47e48520524e03 (diff) | |
parent | d92ad440da788fea9f17bfa4b0185f12644bf714 (diff) | |
download | rsyslog-01fe0fd2ab8a19bdf61bda2256429726ba8e0b53.tar.gz rsyslog-01fe0fd2ab8a19bdf61bda2256429726ba8e0b53.tar.bz2 rsyslog-01fe0fd2ab8a19bdf61bda2256429726ba8e0b53.zip |
Merge branch 'v5-stable' into v5-beta
Conflicts:
runtime/ruleset.c
Diffstat (limited to 'runtime/stream.c')
-rw-r--r-- | runtime/stream.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/runtime/stream.c b/runtime/stream.c index 9645a3fe..d6ee1e39 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -16,7 +16,7 @@ * it turns out to be problematic. Then, we need to quasi-refcount the number of accesses * to the object. * - * Copyright 2008, 2009 Rainer Gerhards and Adiscon GmbH. + * Copyright 2008-2012 Rainer Gerhards and Adiscon GmbH. * * This file is part of the rsyslog runtime library. * @@ -361,7 +361,7 @@ static rsRetVal strmCloseFile(strm_t *pThis) pThis->fdDir = -1; } - if(pThis->bDeleteOnClose) { + if(pThis->bDeleteOnClose && pThis->pszCurrFName != NULL) { if(unlink((char*) pThis->pszCurrFName) == -1) { char errStr[1024]; int err = errno; @@ -369,14 +369,12 @@ static rsRetVal strmCloseFile(strm_t *pThis) DBGPRINTF("error %d unlinking '%s' - ignored: %s\n", errno, pThis->pszCurrFName, errStr); } - } - - pThis->iCurrOffs = 0; /* we are back at begin of file */ - if(pThis->pszCurrFName != NULL) { free(pThis->pszCurrFName); /* no longer needed in any case (just for open) */ pThis->pszCurrFName = NULL; } + pThis->iCurrOffs = 0; /* we are back at begin of file */ + RETiRet; } |