diff options
Diffstat (limited to 'runtime/stream.c')
-rw-r--r-- | runtime/stream.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/stream.c b/runtime/stream.c index ed77a2a6..cc69ce5d 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -1016,6 +1016,7 @@ asyncWriterThread(void *pPtr) struct timespec t; sbool bTimedOut = 0; strm_t *pThis = (strm_t*) pPtr; + int err; ISOBJ_TYPE_assert(pThis, strm); BEGINfunc @@ -1042,8 +1043,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 { @@ -1175,6 +1175,7 @@ static rsRetVal doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf, int bFlush) { int zRet; /* zlib return state */ + sbool bzInitDone = RSFALSE; DEFiRet; unsigned outavail; assert(pThis != NULL); @@ -1191,8 +1192,9 @@ doZipWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf, int bFlush) DBGPRINTF("error %d returned from zlib/deflateInit2()\n", zRet); ABORT_FINALIZE(RS_RET_ZLIB_ERR); } - pThis->bzInitDone = TRUE; + pThis->bzInitDone = RSTRUE; } + bzInitDone = RSTRUE; /* now doing the compression */ pThis->zstrm.next_in = (Bytef*) pBuf; |