diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-08-15 12:59:24 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-08-15 12:59:24 +0200 |
commit | 8a1751d1c9cb463aeb3b9c80bff907bbe3d5cd8a (patch) | |
tree | 21a5726fa380372c08e8975e9c49f9bb6d91feb0 | |
parent | a61e548958044f9efa013b5911d130ae1930448f (diff) | |
parent | 3f2856b4b5010dfcaa720b292dc3a655e7b9f6da (diff) | |
download | rsyslog-8a1751d1c9cb463aeb3b9c80bff907bbe3d5cd8a.tar.gz rsyslog-8a1751d1c9cb463aeb3b9c80bff907bbe3d5cd8a.tar.xz rsyslog-8a1751d1c9cb463aeb3b9c80bff907bbe3d5cd8a.zip |
Merge branch 'v3-stable' into beta
Conflicts:
ChangeLog
configure.ac
doc/rsyslog_ng_comparison.html
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | doc/rsyslog_ng_comparison.html | 9 | ||||
-rw-r--r-- | plugins/imfile/imfile.c | 18 | ||||
-rw-r--r-- | threads.c | 12 |
4 files changed, 35 insertions, 11 deletions
@@ -1,6 +1,6 @@ --------------------------------------------------------------------------- Version 3.19.11 [BETA] (rgerhards), 2008-??-?? -- included fixes from v3-stable +- included fixes from v3-stable (most importantly 3.18.3) --------------------------------------------------------------------------- Version 3.19.10 [BETA] (rgerhards), 2008-07-15 - start of a new beta branch based on former 3.19 devel branch @@ -159,7 +159,10 @@ Version 3.19.0 (rgerhards), 2008-05-06 - -c option no longer must be the first option - thanks to varmjofekoj for the patch --------------------------------------------------------------------------- -Version 3.18.3 (rgerhards), 2008-08-?? +Version 3.18.3 (rgerhards), 2008-08-18 +- bugfix: imfile could cause a segfault upon rsyslogd HUP and termination + Thanks to lperr for an excellent bug report that helped detect this + problem. - enhanced ommysql to support custom port to connect to server Port can be set via new $ActionOmmysqlServerPort config directive Note: this was a very minor change and thus deemed appropriate to be diff --git a/doc/rsyslog_ng_comparison.html b/doc/rsyslog_ng_comparison.html index 600875a8..6d14d933 100644 --- a/doc/rsyslog_ng_comparison.html +++ b/doc/rsyslog_ng_comparison.html @@ -426,13 +426,19 @@ directories (log targets) dynamically</td> <td valign="top">control of log output format, including ability to present channel and priority as visible log data</td> <td valign="top">yes</td> -<td valign="top">not sure...</td> +<td valign="top">yes</td> </tr> +<<<<<<< HEAD:doc/rsyslog_ng_comparison.html <tr> <td valign="top">native ability to send mail messages</td> <td valign="top">yes (<a href="ommail.html">ommail</a>, introduced in 3.17.0)</td> <td valign="top">not sure...</td> +======= +<tr><td valign="top">native ability to send mail messages</td> +<td valign="top">yes (<a href="ommail.html">ommail</a>, introduced in 3.17.0)</td> +<td valign="top">no (only via piped external process)</td> +>>>>>>> 3f2856b4b5010dfcaa720b292dc3a655e7b9f6da:doc/rsyslog_ng_comparison.html </tr> <tr> <td valign="top">good timestamp format control; at a @@ -582,5 +588,4 @@ feature sheet. I have not yet been able to fully work through it. In the mean time, you may want to read it in parallel. It is available at <a href="http://www.balabit.com/network-security/syslog-ng/features/detailed/">Balabit's site</a>.</p> - </body></html> diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c index dbdf6b94..3bc07b9c 100644 --- a/plugins/imfile/imfile.c +++ b/plugins/imfile/imfile.c @@ -187,16 +187,19 @@ static void pollFileCancelCleanup(void *pArg) #pragma GCC diagnostic ignored "-Wempty-body" static rsRetVal pollFile(fileInfo_t *pThis, int *pbHadFileData) { - DEFiRet; cstr_t *pCStr = NULL; + DEFiRet; ASSERT(pbHadFileData != NULL); + /* Note: we must do pthread_cleanup_push() immediately, because the POXIS macros + * otherwise do not work if I include the _cleanup_pop() inside an if... -- rgerhards, 2008-08-14 + */ + pthread_cleanup_push(pollFileCancelCleanup, &pCStr); if(pThis->pStrm == NULL) { CHKiRet(openFile(pThis)); /* open file */ } - pthread_cleanup_push(pollFileCancelCleanup, &pCStr); /* loop below will be exited when strmReadLine() returns EOF */ while(1) { CHKiRet(strmReadLine(pThis->pStrm, &pCStr)); @@ -204,9 +207,18 @@ static rsRetVal pollFile(fileInfo_t *pThis, int *pbHadFileData) CHKiRet(enqLine(pThis, pCStr)); /* process line */ rsCStrDestruct(&pCStr); /* discard string (must be done by us!) */ } - pthread_cleanup_pop(0); finalize_it: + /*EMPTY - just to keep the compiler happy, do NOT remove*/; + /* Note: the problem above is that pthread:cleanup_pop() is a macro which + * evaluates to something like "} while(0);". So the code would become + * "finalize_it: }", that is a label without a statement. The C standard does + * not permit this. So we add an empty statement "finalize_it: ; }" and + * everybody is happy. Note that without the ;, an error is reported only + * on some platforms/compiler versions. -- rgerhards, 2008-08-15 + */ + pthread_cleanup_pop(0); + if(pCStr != NULL) { rsCStrDestruct(&pCStr); } @@ -46,6 +46,7 @@ static linkedList_t llThrds; */ static rsRetVal thrdConstruct(thrdInfo_t **ppThis) { + DEFiRet; thrdInfo_t *pThis; assert(ppThis != NULL); @@ -60,7 +61,7 @@ static rsRetVal thrdConstruct(thrdInfo_t **ppThis) pthread_mutex_init (pThis->mutTermOK, NULL); *ppThis = pThis; - return RS_RET_OK; + RETiRet; } @@ -70,6 +71,7 @@ static rsRetVal thrdConstruct(thrdInfo_t **ppThis) */ static rsRetVal thrdDestruct(thrdInfo_t *pThis) { + DEFiRet; assert(pThis != NULL); if(pThis->bIsActive == 1) { @@ -78,7 +80,7 @@ static rsRetVal thrdDestruct(thrdInfo_t *pThis) free(pThis->mutTermOK); free(pThis); - return RS_RET_OK; + RETiRet; } @@ -86,6 +88,7 @@ static rsRetVal thrdDestruct(thrdInfo_t *pThis) */ rsRetVal thrdTerminate(thrdInfo_t *pThis) { + DEFiRet; assert(pThis != NULL); pthread_cancel(pThis->thrdID); @@ -96,7 +99,7 @@ rsRetVal thrdTerminate(thrdInfo_t *pThis) if(pThis->pAfterRun != NULL) pThis->pAfterRun(pThis); - return RS_RET_OK; + RETiRet; } @@ -104,8 +107,9 @@ rsRetVal thrdTerminate(thrdInfo_t *pThis) */ rsRetVal thrdTerminateAll(void) { + DEFiRet; llDestroy(&llThrds); - return RS_RET_OK; + RETiRet; } |