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 modPrepareUnload(modInfo_t* pThis)
{
    DEFiRet;
    void* pModCookie;

    assert(pThis != NULL);

    if (pThis->uRefCnt > 0)
    {
        dbgprintf(
            "rejecting unload of module '%s' because it has a refcount of %d\n",
            pThis->pszName, pThis->uRefCnt);
        ABORT_FINALIZE(RS_RET_MODULE_STILL_REFERENCED);
    }

    CHKiRet(pThis->modGetID(&pModCookie));
    pThis->modExit(); /* tell the module to get ready for unload */
    CHKiRet(unregCfSysLineHdlrs4Owner(pModCookie));

finalize_it:
    RETiRet;
}
/* Prepare a module for unloading.
 * This is currently a dummy, to be filled when we have a plug-in
 * interface - rgerhards, 2007-08-09
 * rgerhards, 2007-11-21:
 * When this function is called, all instance-data must already have
 * been destroyed. In the case of output modules, this happens when the
 * rule set is being destroyed. When we implement other module types, we
 * need to think how we handle it there (and if we have any instance data).
 * rgerhards, 2008-03-10: reject unload request if the module has a reference
 * count > 0.
 */
Prepare a module for unloading.
Prepare a module for unloading .
static rsRetVal modPrepareUnload(modInfo_t* pThis)
{
    DEFiRet;
    void* pModCookie;
    assert(pThis != NULL);
    if (pThis->uRefCnt > 0)
    {
        dbgprintf(
            "rejecting unload of module '%s' because it has a refcount of %d\n",
            pThis->pszName, pThis->uRefCnt);
        ABORT_FINALIZE(RS_RET_MODULE_STILL_REFERENCED);
    }
    CHKiRet(pThis->modGetID(&pModCookie));
    pThis->modExit(); 
    CHKiRet(unregCfSysLineHdlrs4Owner(pModCookie));
finalize_it:
    RETiRet;
}
static rsRetVal modPrepareUnload ( modInfo_t * pThis ) { DEFiRet ; void * pModCookie ; assert ( pThis != NULL ) ; if ( pThis -> uRefCnt > 0 ) { dbgprintf ( " \n " , pThis -> pszName , pThis -> uRefCnt ) ; ABORT_FINALIZE ( RS_RET_MODULE_STILL_REFERENCED ) ; } CHKiRet ( pThis -> modGetID ( & pModCookie ) ) ; pThis -> modExit ( ) ; CHKiRet ( unregCfSysLineHdlrs4Owner ( pModCookie ) ) ; finalize_it : RETiRet ; }
Prepare a module for unloading.
Prepare a module for unloading .
/* tell the module to get ready for unload */