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/modules.c
static rsRetVal modUnloadAndDestructAll(eModLinkType_t modLinkTypesToUnload)
{
    DEFiRet;
    modInfo_t* pModCurr; /* module currently being processed */

    pModCurr = GetNxt(NULL);
    while (pModCurr != NULL)
    {
        if (modLinkTypesToUnload == eMOD_LINK_ALL ||
            pModCurr->eLinkType == modLinkTypesToUnload)
        {
            if (modUnlinkAndDestroy(&pModCurr) ==
                RS_RET_MODULE_STILL_REFERENCED)
            {
                pModCurr = GetNxt(pModCurr);
            }
            else
            {
                /* Note: if the module was successfully unloaded, it has updated
                 * the pModCurr pointer to the next module. However, the unload
                 * process may still have indirectly referenced the pointer list
                 * in a way that the unloaded module is not aware of. So we
                 * restart the unload process to make sure we do not fall into a
                 * trap (what we did ;)). The performance toll is minimal. --
                 * rgerhards, 2008-04-28
                 */
                pModCurr = GetNxt(NULL);
            }
        }
        else
        {
            pModCurr = GetNxt(pModCurr);
        }
    }

    RETiRet;
}
/* unload all loaded modules of a specific type (use eMOD_ALL if you want to
 * unload all module types). The unload happens only if the module is no longer
 * referenced. So some modules may survive this call.
 * rgerhards, 2008-03-11
 */
unload all loaded modules of a specific type (use eMOD_ALL if you want to
unload all module types). The unload happens only if the module is no longer
referenced. So some modules may survive this call.
unload all loaded modules of a specific type ( use eMOD_ALL if you want to unload all module types ) . The unload happens only if the module is no longer referenced . So some modules may survive this call .
static rsRetVal modUnloadAndDestructAll(eModLinkType_t modLinkTypesToUnload)
{
    DEFiRet;
    modInfo_t* pModCurr; 
    pModCurr = GetNxt(NULL);
    while (pModCurr != NULL)
    {
        if (modLinkTypesToUnload == eMOD_LINK_ALL ||
            pModCurr->eLinkType == modLinkTypesToUnload)
        {
            if (modUnlinkAndDestroy(&pModCurr) ==
                RS_RET_MODULE_STILL_REFERENCED)
            {
                pModCurr = GetNxt(pModCurr);
            }
            else
            {
                pModCurr = GetNxt(NULL);
            }
        }
        else
        {
            pModCurr = GetNxt(pModCurr);
        }
    }
    RETiRet;
}
static rsRetVal modUnloadAndDestructAll ( eModLinkType_t modLinkTypesToUnload ) { DEFiRet ; modInfo_t * pModCurr ; pModCurr = GetNxt ( NULL ) ; while ( pModCurr != NULL ) { if ( modLinkTypesToUnload == eMOD_LINK_ALL || pModCurr -> eLinkType == modLinkTypesToUnload ) { if ( modUnlinkAndDestroy ( & pModCurr ) == RS_RET_MODULE_STILL_REFERENCED ) { pModCurr = GetNxt ( pModCurr ) ; } else { pModCurr = GetNxt ( NULL ) ; } } else { pModCurr = GetNxt ( pModCurr ) ; } } RETiRet ; }
unload all loaded modules of a specific type (use eMOD_ALL if you want to
 unload all module types).
unload all loaded modules of a specific type ( use eMOD_ALL if you want to unload all module types ) .
/* module currently being processed */ /* Note: if the module was successfully unloaded, it has updated
                 * the pModCurr pointer to the next module. However, the unload
                 * process may still have indirectly referenced the pointer list
                 * in a way that the unloaded module is not aware of. So we
                 * restart the unload process to make sure we do not fall into a
                 * trap (what we did ;)). The performance toll is minimal. --
                 * rgerhards, 2008-04-28
                 */