summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-08-22 16:54:41 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-08-22 16:54:41 +0200
commitc8d66987a2aff47d5cd8d1dc811893ce91c8410d (patch)
treede6c27efa1e176a0d4798d17235dd3aaeb821064
parent01fe0fd2ab8a19bdf61bda2256429726ba8e0b53 (diff)
downloadrsyslog-c8d66987a2aff47d5cd8d1dc811893ce91c8410d.tar.gz
rsyslog-c8d66987a2aff47d5cd8d1dc811893ce91c8410d.tar.xz
rsyslog-c8d66987a2aff47d5cd8d1dc811893ce91c8410d.zip
small bugfix: stream timeout API use was incorrect
Thanks to Andre Lorbach for mentioning this.
-rw-r--r--runtime/stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/stream.c b/runtime/stream.c
index d6ee1e39..742799d2 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -1010,6 +1010,7 @@ asyncWriterThread(void *pPtr)
struct timespec t;
sbool bTimedOut = 0;
strm_t *pThis = (strm_t*) pPtr;
+ int err;
ISOBJ_TYPE_assert(pThis, strm);
BEGINfunc
@@ -1036,8 +1037,7 @@ asyncWriterThread(void *pPtr)
bTimedOut = 0;
timeoutComp(&t, pThis->iFlushInterval * 1000); /* *1000 millisconds */
if(pThis->bDoTimedWait) {
- if(pthread_cond_timedwait(&pThis->notEmpty, &pThis->mut, &t) != 0) {
- int err = errno;
+ if((err = pthread_cond_timedwait(&pThis->notEmpty, &pThis->mut, &t)) != 0) {
if(err == ETIMEDOUT) {
bTimedOut = 1;
} else {