From c8d66987a2aff47d5cd8d1dc811893ce91c8410d Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 22 Aug 2012 16:54:41 +0200 Subject: small bugfix: stream timeout API use was incorrect Thanks to Andre Lorbach for mentioning this. --- runtime/stream.c | 4 ++-- 1 file 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 { -- cgit