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 strmNextFile(strm_t* pThis)
{
    DEFiRet;

    assert(pThis != NULL);
    assert(pThis->sType == STREAMTYPE_FILE_CIRCULAR);
    assert(pThis->iMaxFiles != 0);
    assert(pThis->fd != -1);

    CHKiRet(strmCloseFile(pThis));

    /* we do modulo operation to ensure we obey the iMaxFile property. This will
     * always result in a file number lower than iMaxFile, so it if wraps, the
     * name is back to 0, which results in the first file being overwritten. Not
     * desired for queues, so make sure their iMaxFiles is large enough. But it
     * is well-desired for other use cases, e.g. a circular output log file. --
     * rgerhards, 2008-01-10
     */
    pThis->iCurrFNum = (pThis->iCurrFNum + 1) % pThis->iMaxFiles;

finalize_it:
    RETiRet;
}
/* switch to next strm file
 * This method must only be called if we are in a multi-file mode!
 */
switch to next strm file
This method must only be called if we are in a multi-file mode!
switch to next strm file This method must only be called if we are in a multi - file mode!
static rsRetVal strmNextFile(strm_t* pThis)
{
    DEFiRet;
    assert(pThis != NULL);
    assert(pThis->sType == STREAMTYPE_FILE_CIRCULAR);
    assert(pThis->iMaxFiles != 0);
    assert(pThis->fd != -1);
    CHKiRet(strmCloseFile(pThis));
    pThis->iCurrFNum = (pThis->iCurrFNum + 1) % pThis->iMaxFiles;
finalize_it:
    RETiRet;
}
static rsRetVal strmNextFile ( strm_t * pThis ) { DEFiRet ; assert ( pThis != NULL ) ; assert ( pThis -> sType == STREAMTYPE_FILE_CIRCULAR ) ; assert ( pThis -> iMaxFiles != 0 ) ; assert ( pThis -> fd != -1 ) ; CHKiRet ( strmCloseFile ( pThis ) ) ; pThis -> iCurrFNum = ( pThis -> iCurrFNum + 1 ) % pThis -> iMaxFiles ; finalize_it : RETiRet ; }
switch to next strm file
 This method must only be called if we are in a multi-file mode!
switch to next strm file This method must only be called if we are in a multi - file mode!
/* we do modulo operation to ensure we obey the iMaxFile property. This will
     * always result in a file number lower than iMaxFile, so it if wraps, the
     * name is back to 0, which results in the first file being overwritten. Not
     * desired for queues, so make sure their iMaxFiles is large enough. But it
     * is well-desired for other use cases, e.g. a circular output log file. --
     * rgerhards, 2008-01-10
     */