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/tools/iminternal.c
rsRetVal iminternalRemoveMsg(smsg_t** ppMsg)
{
    DEFiRet;
    iminternal_t* pThis;
    linkedListCookie_t llCookie = NULL;

    pthread_mutex_lock(&mutList);
    CHKiRet(llGetNextElt(&llMsgs, &llCookie, (void*)&pThis));
    *ppMsg = pThis->pMsg;
    pThis->pMsg = NULL; /* we do no longer own it - important for destructor */

    if (llDestroyRootElt(&llMsgs) != RS_RET_OK)
    {
        dbgprintf(
            "Root element of iminternal linked list could not be destroyed - "
            "there is "
            "nothing we can do against it, we ignore it for now. Things may go "
            "wild "
            "from here on. This is most probably a program logic error.\n");
    }

finalize_it:
    pthread_mutex_unlock(&mutList);
    RETiRet;
}
/* pull the first error message from the linked list, remove it
 * from the list and return it to the caller. The caller is
 * responsible for freeing the message!
 */
pull the first error message from the linked list, remove it
from the list and return it to the caller. The caller is
responsible for freeing the message!
pull the first error message from the linked list remove it from the list and return it to the caller . The caller is responsible for freeing the message!
rsRetVal iminternalRemoveMsg(smsg_t** ppMsg)
{
    DEFiRet;
    iminternal_t* pThis;
    linkedListCookie_t llCookie = NULL;
    pthread_mutex_lock(&mutList);
    CHKiRet(llGetNextElt(&llMsgs, &llCookie, (void*)&pThis));
    *ppMsg = pThis->pMsg;
    pThis->pMsg = NULL; 
    if (llDestroyRootElt(&llMsgs) != RS_RET_OK)
    {
        dbgprintf(
            "Root element of iminternal linked list could not be destroyed - "
            "there is "
            "nothing we can do against it, we ignore it for now. Things may go "
            "wild "
            "from here on. This is most probably a program logic error.\n");
    }
finalize_it:
    pthread_mutex_unlock(&mutList);
    RETiRet;
}
rsRetVal iminternalRemoveMsg ( smsg_t * * ppMsg ) { DEFiRet ; iminternal_t * pThis ; linkedListCookie_t llCookie = NULL ; pthread_mutex_lock ( & mutList ) ; CHKiRet ( llGetNextElt ( & llMsgs , & llCookie , ( void * ) & pThis ) ) ; * ppMsg = pThis -> pMsg ; pThis -> pMsg = NULL ; if ( llDestroyRootElt ( & llMsgs ) != RS_RET_OK ) { dbgprintf ( " " " " " " " " " \n " ) ; } finalize_it : pthread_mutex_unlock ( & mutList ) ; RETiRet ; }
pull the first error message from the linked list, remove it
 from the list and return it to the caller.
pull the first error message from the linked list remove it from the list and return it to the caller .
/* we do no longer own it - important for destructor */