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/nsdpoll_ptcp.c
static rsRetVal unlinkEvent(nsdpoll_ptcp_t* pThis, int id, void* pUsr,
                            nsdpoll_epollevt_lst_t** ppEvtLst)
{
    nsdpoll_epollevt_lst_t* pEvtLst;
    nsdpoll_epollevt_lst_t* pPrev = NULL;
    DEFiRet;

    pthread_mutex_lock(&pThis->mutEvtLst);
    pEvtLst = pThis->pRoot;
    while (pEvtLst != NULL && !(pEvtLst->id == id && pEvtLst->pUsr == pUsr))
    {
        pPrev = pEvtLst;
        pEvtLst = pEvtLst->pNext;
    }
    if (pEvtLst == NULL)
        ABORT_FINALIZE(RS_RET_NOT_FOUND);

    *ppEvtLst = pEvtLst;

    /* unlink */
    if (pPrev == NULL)
        pThis->pRoot = pEvtLst->pNext;
    else
        pPrev->pNext = pEvtLst->pNext;

finalize_it:
    pthread_mutex_unlock(&pThis->mutEvtLst);
    RETiRet;
}
/* find and unlink the entry identified by id/pUsr from the list.
 * rgerhards, 2009-11-23
 */
find and unlink the entry identified by id/pUsr from the list.
find and unlink the entry identified by id / pUsr from the list .
static rsRetVal unlinkEvent(nsdpoll_ptcp_t* pThis, int id, void* pUsr,
                            nsdpoll_epollevt_lst_t** ppEvtLst)
{
    nsdpoll_epollevt_lst_t* pEvtLst;
    nsdpoll_epollevt_lst_t* pPrev = NULL;
    DEFiRet;
    pthread_mutex_lock(&pThis->mutEvtLst);
    pEvtLst = pThis->pRoot;
    while (pEvtLst != NULL && !(pEvtLst->id == id && pEvtLst->pUsr == pUsr))
    {
        pPrev = pEvtLst;
        pEvtLst = pEvtLst->pNext;
    }
    if (pEvtLst == NULL)
        ABORT_FINALIZE(RS_RET_NOT_FOUND);
    *ppEvtLst = pEvtLst;
    if (pPrev == NULL)
        pThis->pRoot = pEvtLst->pNext;
    else
        pPrev->pNext = pEvtLst->pNext;
finalize_it:
    pthread_mutex_unlock(&pThis->mutEvtLst);
    RETiRet;
}
static rsRetVal unlinkEvent ( nsdpoll_ptcp_t * pThis , int id , void * pUsr , nsdpoll_epollevt_lst_t * * ppEvtLst ) { nsdpoll_epollevt_lst_t * pEvtLst ; nsdpoll_epollevt_lst_t * pPrev = NULL ; DEFiRet ; pthread_mutex_lock ( & pThis -> mutEvtLst ) ; pEvtLst = pThis -> pRoot ; while ( pEvtLst != NULL && ! ( pEvtLst -> id == id && pEvtLst -> pUsr == pUsr ) ) { pPrev = pEvtLst ; pEvtLst = pEvtLst -> pNext ; } if ( pEvtLst == NULL ) ABORT_FINALIZE ( RS_RET_NOT_FOUND ) ; * ppEvtLst = pEvtLst ; if ( pPrev == NULL ) pThis -> pRoot = pEvtLst -> pNext ; else pPrev -> pNext = pEvtLst -> pNext ; finalize_it : pthread_mutex_unlock ( & pThis -> mutEvtLst ) ; RETiRet ; }
find and unlink the entry identified by id/pUsr from the list.
find and unlink the entry identified by id / pUsr from the list .
/* unlink */