Esempio n. 1
0
void ScopeCopy(const char *new_ns, const char *new_scopename, const Scope *old_scope)
/*
 * Thread safe
 */
{
    ScopeNew(new_ns, new_scopename);

    if (!ThreadLock(cft_vscope))
    {
        Log(LOG_LEVEL_ERR, "Could not lock VSCOPE");
        return;
    }

    if (old_scope)
    {
        Scope *np = ScopeGet(new_ns, new_scopename);
        HashCopy(np->hashtable, old_scope->hashtable);
    }

    ThreadUnlock(cft_vscope);
}
Esempio n. 2
0
void ScopeCopy(const char *new_scopename, const Scope *old_scope)
/*
 * Thread safe
 */
{
    CfDebug("\n*\nCopying scope data %s to %s\n*\n", old_scope->scope, new_scopename);

    ScopeNew(new_scopename);

    if (!ThreadLock(cft_vscope))
    {
        CfOut(OUTPUT_LEVEL_ERROR, "", "!! Could not lock VSCOPE");
        return;
    }

    if (old_scope)
    {
        Scope *np = ScopeGet(new_scopename);
        HashCopy(np->hashtable, old_scope->hashtable);
    }

    ThreadUnlock(cft_vscope);
}