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/glbl.c
void glblProcessCnf(struct cnfobj* o)
{
    int i;

    cnfparamvals = nvlstGetParams(o->nvlst, &paramblk, cnfparamvals);
    if (cnfparamvals == NULL)
    {
        LogError(0, RS_RET_MISSING_CNFPARAMS,
                 "error processing global "
                 "config parameters [global(...)]");
        goto done;
    }
    if (Debug)
    {
        dbgprintf("glbl param blk after glblProcessCnf:\n");
        cnfparamsPrint(&paramblk, cnfparamvals);
    }

    /* The next thing is a bit hackish and should be changed in higher
     * versions. There are a select few parameters which we need to
     * act on immediately. These are processed here.
     */
    for (i = 0; i < paramblk.nParams; ++i)
    {
        if (!cnfparamvals[i].bUsed)
            continue;
        if (!strcmp(paramblk.descr[i].name, "processinternalmessages"))
        {
            bProcessInternalMessages = (int)cnfparamvals[i].val.d.n;
        }
        else if (!strcmp(paramblk.descr[i].name,
                         "internal.developeronly.options"))
        {
            glblDevOptions = (uint64_t)cnfparamvals[i].val.d.n;
        }
        else if (!strcmp(paramblk.descr[i].name, "stdlog.channelspec"))
        {
#ifndef ENABLE_LIBLOGGING_STDLOG
            LogError(0, RS_RET_ERR,
                     "rsyslog wasn't "
                     "compiled with liblogging-stdlog support. "
                     "The 'stdlog.channelspec' parameter "
                     "is ignored. Note: the syslog API is used instead.\n");
#else
            stdlog_chanspec =
                (uchar*)es_str2cstr(cnfparamvals[i].val.d.estr, NULL);
            /* we need to re-open with the new channel */
            stdlog_close(stdlog_hdl);
            stdlog_hdl = stdlog_open("rsyslogd", 0, STDLOG_SYSLOG,
                                     (char*)stdlog_chanspec);
#endif
        }
        else if (!strcmp(paramblk.descr[i].name, "operatingstatefile"))
        {
            if (operatingStateFile != NULL)
            {
                LogError(errno, RS_RET_PARAM_ERROR,
                         "error: operatingStateFile already set to '%s' - "
                         "new valule ignored",
                         operatingStateFile);
            }
            else
            {
                operatingStateFile =
                    (uchar*)es_str2cstr(cnfparamvals[i].val.d.estr, NULL);
                osf_open();
            }
        }
    }
done:
    return;
}
/* handle a global config object. Note that multiple global config statements
 * are permitted (because of plugin support), so once we got a param block,
 * we need to hold to it.
 * rgerhards, 2011-07-19
 */
handle a global config object. Note that multiple global config statements
are permitted (because of plugin support), so once we got a param block,
we need to hold to it.
handle a global config object . Note that multiple global config statements are permitted ( because of plugin support ) so once we got a param block we need to hold to it .
void glblProcessCnf(struct cnfobj* o)
{
    int i;
    cnfparamvals = nvlstGetParams(o->nvlst, &paramblk, cnfparamvals);
    if (cnfparamvals == NULL)
    {
        LogError(0, RS_RET_MISSING_CNFPARAMS,
                 "error processing global "
                 "config parameters [global(...)]");
        goto done;
    }
    if (Debug)
    {
        dbgprintf("glbl param blk after glblProcessCnf:\n");
        cnfparamsPrint(&paramblk, cnfparamvals);
    }
    for (i = 0; i < paramblk.nParams; ++i)
    {
        if (!cnfparamvals[i].bUsed)
            continue;
        if (!strcmp(paramblk.descr[i].name, "processinternalmessages"))
        {
            bProcessInternalMessages = (int)cnfparamvals[i].val.d.n;
        }
        else if (!strcmp(paramblk.descr[i].name,
                         "internal.developeronly.options"))
        {
            glblDevOptions = (uint64_t)cnfparamvals[i].val.d.n;
        }
        else if (!strcmp(paramblk.descr[i].name, "stdlog.channelspec"))
        {
#ifndef ENABLE_LIBLOGGING_STDLOG
            LogError(0, RS_RET_ERR,
                     "rsyslog wasn't "
                     "compiled with liblogging-stdlog support. "
                     "The 'stdlog.channelspec' parameter "
                     "is ignored. Note: the syslog API is used instead.\n");
#else
            stdlog_chanspec =
                (uchar*)es_str2cstr(cnfparamvals[i].val.d.estr, NULL);
            stdlog_close(stdlog_hdl);
            stdlog_hdl = stdlog_open("rsyslogd", 0, STDLOG_SYSLOG,
                                     (char*)stdlog_chanspec);
#endif
        }
        else if (!strcmp(paramblk.descr[i].name, "operatingstatefile"))
        {
            if (operatingStateFile != NULL)
            {
                LogError(errno, RS_RET_PARAM_ERROR,
                         "error: operatingStateFile already set to '%s' - "
                         "new valule ignored",
                         operatingStateFile);
            }
            else
            {
                operatingStateFile =
                    (uchar*)es_str2cstr(cnfparamvals[i].val.d.estr, NULL);
                osf_open();
            }
        }
    }
done:
    return;
}
void glblProcessCnf ( struct cnfobj * o ) { int i ; cnfparamvals = nvlstGetParams ( o -> nvlst , & paramblk , cnfparamvals ) ; if ( cnfparamvals == NULL ) { LogError ( 0 , RS_RET_MISSING_CNFPARAMS , " " " " ) ; goto done ; } if ( Debug ) { dbgprintf ( " \n " ) ; cnfparamsPrint ( & paramblk , cnfparamvals ) ; } for ( i = 0 ; i < paramblk . nParams ; ++ i ) { if ( ! cnfparamvals [ i ] . bUsed ) continue ; if ( ! strcmp ( paramblk . descr [ i ] . name , " " ) ) { bProcessInternalMessages = ( int ) cnfparamvals [ i ] . val . d . n ; } else if ( ! strcmp ( paramblk . descr [ i ] . name , " " ) ) { glblDevOptions = ( uint64_t ) cnfparamvals [ i ] . val . d . n ; } else if ( ! strcmp ( paramblk . descr [ i ] . name , " " ) ) { #ifndef ENABLE_LIBLOGGING_STDLOG LogError ( 0 , RS_RET_ERR , " " " " " " " \n " ) ; #else stdlog_chanspec = ( uchar * ) es_str2cstr ( cnfparamvals [ i ] . val . d . estr , NULL ) ; stdlog_close ( stdlog_hdl ) ; stdlog_hdl = stdlog_open ( " " , 0 , STDLOG_SYSLOG , ( char * ) stdlog_chanspec ) ; #endif } else if ( ! strcmp ( paramblk . descr [ i ] . name , " " ) ) { if ( operatingStateFile != NULL ) { LogError ( errno , RS_RET_PARAM_ERROR , " " " " , operatingStateFile ) ; } else { operatingStateFile = ( uchar * ) es_str2cstr ( cnfparamvals [ i ] . val . d . estr , NULL ) ; osf_open ( ) ; } } } done : return ; }
handle a global config object.
handle a global config object .
/* The next thing is a bit hackish and should be changed in higher
     * versions. There are a select few parameters which we need to
     * act on immediately. These are processed here.
     */ /* we need to re-open with the new channel */