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 strmSchedWrite(strm_t* pThis, uchar* pBuf, size_t lenBuf,
                               const int bFlushZip)
{
    DEFiRet;

    assert(pThis != NULL);

    /* we need to reset the buffer pointer BEFORE calling the actual write
     * function. Otherwise, in circular mode, the write function will
     * potentially close the file, then close will flush and as the
     * buffer pointer is nonzero, will re-call into this code here. In
     * the end result, we than have a problem (and things are screwed
     * up). So we reset the buffer pointer first, and all this can
     * not happen. It is safe to do so, because that pointer is NOT
     * used inside the write functions. -- rgerhads, 2010-03-10
     */
    pThis->iBufPtr = 0; /* we are at the begin of a new buffer */
    if (pThis->bAsyncWrite)
    {
        CHKiRet(doAsyncWriteInternal(pThis, lenBuf, bFlushZip));
    }
    else
    {
        CHKiRet(doWriteInternal(pThis, pBuf, lenBuf, bFlushZip));
    }

finalize_it:
    RETiRet;
}
/* schedule writing to the stream. Depending on our concurrency settings,
 * this either directly writes to the stream or schedules writing via
 * the background thread. -- rgerhards, 2009-07-07
 */
schedule writing to the stream. Depending on our concurrency settings,
this either directly writes to the stream or schedules writing via
the background thread.
schedule writing to the stream . Depending on our concurrency settings this either directly writes to the stream or schedules writing via the background thread .
static rsRetVal strmSchedWrite(strm_t* pThis, uchar* pBuf, size_t lenBuf,
                               const int bFlushZip)
{
    DEFiRet;
    assert(pThis != NULL);
    pThis->iBufPtr = 0; 
    if (pThis->bAsyncWrite)
    {
        CHKiRet(doAsyncWriteInternal(pThis, lenBuf, bFlushZip));
    }
    else
    {
        CHKiRet(doWriteInternal(pThis, pBuf, lenBuf, bFlushZip));
    }
finalize_it:
    RETiRet;
}
static rsRetVal strmSchedWrite ( strm_t * pThis , uchar * pBuf , size_t lenBuf , const int bFlushZip ) { DEFiRet ; assert ( pThis != NULL ) ; pThis -> iBufPtr = 0 ; if ( pThis -> bAsyncWrite ) { CHKiRet ( doAsyncWriteInternal ( pThis , lenBuf , bFlushZip ) ) ; } else { CHKiRet ( doWriteInternal ( pThis , pBuf , lenBuf , bFlushZip ) ) ; } finalize_it : RETiRet ; }
schedule writing to the stream.
schedule writing to the stream .
/* we need to reset the buffer pointer BEFORE calling the actual write
     * function. Otherwise, in circular mode, the write function will
     * potentially close the file, then close will flush and as the
     * buffer pointer is nonzero, will re-call into this code here. In
     * the end result, we than have a problem (and things are screwed
     * up). So we reset the buffer pointer first, and all this can
     * not happen. It is safe to do so, because that pointer is NOT
     * used inside the write functions. -- rgerhads, 2010-03-10
     */ /* we are at the begin of a new buffer */