openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/runtime/stream.c
static rsRetVal doZipFinish(strm_t* pThis)
{
    int zRet; /* zlib return state */
    DEFiRet;
    unsigned outavail;
    assert(pThis != NULL);

    if (!pThis->bzInitDone)
        goto done;

    pThis->zstrm.avail_in = 0;
    /* run deflate() on buffer until everything has been compressed */
    do
    {
        DBGPRINTF("in deflate() loop, avail_in %d, total_in %ld\n",
                  pThis->zstrm.avail_in, pThis->zstrm.total_in);
        pThis->zstrm.avail_out = pThis->sIOBufSize;
        pThis->zstrm.next_out = pThis->pZipBuf;
        zRet = zlibw.Deflate(&pThis->zstrm, Z_FINISH); /* no bad return value */
        DBGPRINTF("after deflate, ret %d, avail_out %d\n", zRet,
                  pThis->zstrm.avail_out);
        outavail = pThis->sIOBufSize - pThis->zstrm.avail_out;
        if (outavail != 0)
        {
            CHKiRet(strmPhysWrite(pThis, (uchar*)pThis->pZipBuf, outavail));
        }
    } while (pThis->zstrm.avail_out == 0);

finalize_it:
    zRet = zlibw.DeflateEnd(&pThis->zstrm);
    if (zRet != Z_OK)
    {
        LogError(0, RS_RET_ZLIB_ERR, "error %d returned from zlib/deflateEnd()",
                 zRet);
    }

    pThis->bzInitDone = 0;
done:
    RETiRet;
}
/* finish zlib buffer, to be called before closing the ZIP file (if
 * running in stream mode).
 */
finish zlib buffer, to be called before closing the ZIP file (if
running in stream mode).
finish zlib buffer to be called before closing the ZIP file ( if running in stream mode ) .
static rsRetVal doZipFinish(strm_t* pThis)
{
    int zRet; 
    DEFiRet;
    unsigned outavail;
    assert(pThis != NULL);
    if (!pThis->bzInitDone)
        goto done;
    pThis->zstrm.avail_in = 0;
    do
    {
        DBGPRINTF("in deflate() loop, avail_in %d, total_in %ld\n",
                  pThis->zstrm.avail_in, pThis->zstrm.total_in);
        pThis->zstrm.avail_out = pThis->sIOBufSize;
        pThis->zstrm.next_out = pThis->pZipBuf;
        zRet = zlibw.Deflate(&pThis->zstrm, Z_FINISH); 
        DBGPRINTF("after deflate, ret %d, avail_out %d\n", zRet,
                  pThis->zstrm.avail_out);
        outavail = pThis->sIOBufSize - pThis->zstrm.avail_out;
        if (outavail != 0)
        {
            CHKiRet(strmPhysWrite(pThis, (uchar*)pThis->pZipBuf, outavail));
        }
    } while (pThis->zstrm.avail_out == 0);
finalize_it:
    zRet = zlibw.DeflateEnd(&pThis->zstrm);
    if (zRet != Z_OK)
    {
        LogError(0, RS_RET_ZLIB_ERR, "error %d returned from zlib/deflateEnd()",
                 zRet);
    }
    pThis->bzInitDone = 0;
done:
    RETiRet;
}
static rsRetVal doZipFinish ( strm_t * pThis ) { int zRet ; DEFiRet ; unsigned outavail ; assert ( pThis != NULL ) ; if ( ! pThis -> bzInitDone ) goto done ; pThis -> zstrm . avail_in = 0 ; do { DBGPRINTF ( " \n " , pThis -> zstrm . avail_in , pThis -> zstrm . total_in ) ; pThis -> zstrm . avail_out = pThis -> sIOBufSize ; pThis -> zstrm . next_out = pThis -> pZipBuf ; zRet = zlibw . Deflate ( & pThis -> zstrm , Z_FINISH ) ; DBGPRINTF ( " \n " , zRet , pThis -> zstrm . avail_out ) ; outavail = pThis -> sIOBufSize - pThis -> zstrm . avail_out ; if ( outavail != 0 ) { CHKiRet ( strmPhysWrite ( pThis , ( uchar * ) pThis -> pZipBuf , outavail ) ) ; } } while ( pThis -> zstrm . avail_out == 0 ) ; finalize_it : zRet = zlibw . DeflateEnd ( & pThis -> zstrm ) ; if ( zRet != Z_OK ) { LogError ( 0 , RS_RET_ZLIB_ERR , " " , zRet ) ; } pThis -> bzInitDone = 0 ; done : RETiRet ; }
finish zlib buffer, to be called before closing the ZIP file (if
 running in stream mode).
finish zlib buffer to be called before closing the ZIP file ( if running in stream mode ) .
/* zlib return state */ /* run deflate() on buffer until everything has been compressed */ /* no bad return value */