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 strmSetFName(strm_t* pThis, uchar* pszName, size_t iLenName)
{
    DEFiRet;

    assert(pThis != NULL);
    assert(pszName != NULL);

    if (iLenName < 1)
        ABORT_FINALIZE(RS_RET_FILE_PREFIX_MISSING);

    if (pThis->pszFName != NULL)
        free(pThis->pszFName);

    if ((pThis->pszFName = malloc(iLenName + 1)) == NULL)
        ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);

    memcpy(pThis->pszFName, pszName,
           iLenName + 1); /* always think about the \0! */
    pThis->lenFName = iLenName;

finalize_it:
    RETiRet;
}
/* set the stream's file prefix
 * The passed-in string is duplicated. So if the caller does not need
 * it any longer, it must free it.
 * rgerhards, 2008-01-09
 */
set the stream's file prefix
The passed-in string is duplicated. So if the caller does not need
it any longer, it must free it.
set the stream ' s file prefix The passed - in string is duplicated . So if the caller does not need it any longer it must free it .
static rsRetVal strmSetFName(strm_t* pThis, uchar* pszName, size_t iLenName)
{
    DEFiRet;
    assert(pThis != NULL);
    assert(pszName != NULL);
    if (iLenName < 1)
        ABORT_FINALIZE(RS_RET_FILE_PREFIX_MISSING);
    if (pThis->pszFName != NULL)
        free(pThis->pszFName);
    if ((pThis->pszFName = malloc(iLenName + 1)) == NULL)
        ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
    memcpy(pThis->pszFName, pszName,
           iLenName + 1); 
    pThis->lenFName = iLenName;
finalize_it:
    RETiRet;
}
static rsRetVal strmSetFName ( strm_t * pThis , uchar * pszName , size_t iLenName ) { DEFiRet ; assert ( pThis != NULL ) ; assert ( pszName != NULL ) ; if ( iLenName < 1 ) ABORT_FINALIZE ( RS_RET_FILE_PREFIX_MISSING ) ; if ( pThis -> pszFName != NULL ) free ( pThis -> pszFName ) ; if ( ( pThis -> pszFName = malloc ( iLenName + 1 ) ) == NULL ) ABORT_FINALIZE ( RS_RET_OUT_OF_MEMORY ) ; memcpy ( pThis -> pszFName , pszName , iLenName + 1 ) ; pThis -> lenFName = iLenName ; finalize_it : RETiRet ; }
set the stream's file prefix
 The passed-in string is duplicated.
set the stream ' s file prefix The passed - in string is duplicated .
/* always think about the \0! */