openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/dbus/1.12.16-r0/dbus-1.12.16/bus/bus.c
static dbus_bool_t process_config_every_time(BusContext* context,
                                             BusConfigParser* parser,
                                             dbus_bool_t is_reload,
                                             DBusError* error)
{
    DBusString full_address;
    DBusList* link;
    DBusList** dirs;
    char* addr;
    const char* servicehelper;
    char* s;

    dbus_bool_t retval;

    _DBUS_ASSERT_ERROR_IS_CLEAR(error);

    addr = NULL;
    retval = FALSE;

    if (!_dbus_string_init(&full_address))
    {
        BUS_SET_OOM(error);
        return FALSE;
    }

    /* get our limits and timeout lengths */
    bus_config_parser_get_limits(parser, &context->limits);

    if (context->policy)
        bus_policy_unref(context->policy);
    context->policy = bus_config_parser_steal_policy(parser);
    _dbus_assert(context->policy != NULL);

    /* context->connections is NULL when creating new BusContext */
    if (context->connections)
    {
        _dbus_verbose("Reload policy rules for completed connections\n");
        retval = bus_connections_reload_policy(context->connections, error);
        if (!retval)
        {
            _DBUS_ASSERT_ERROR_IS_SET(error);
            goto failed;
        }
    }

    /* We have to build the address backward, so that
     * <listen> later in the config file have priority
     */
    link = _dbus_list_get_last_link(&context->servers);
    while (link != NULL)
    {
        addr = dbus_server_get_address(link->data);
        if (addr == NULL)
        {
            BUS_SET_OOM(error);
            goto failed;
        }

        if (_dbus_string_get_length(&full_address) > 0)
        {
            if (!_dbus_string_append(&full_address, ";"))
            {
                BUS_SET_OOM(error);
                goto failed;
            }
        }

        if (!_dbus_string_append(&full_address, addr))
        {
            BUS_SET_OOM(error);
            goto failed;
        }

        dbus_free(addr);
        addr = NULL;

        link = _dbus_list_get_prev_link(&context->servers, link);
    }

    if (is_reload)
        dbus_free(context->address);

    if (!_dbus_string_copy_data(&full_address, &context->address))
    {
        BUS_SET_OOM(error);
        goto failed;
    }

    /* get the service directories */
    dirs = bus_config_parser_get_service_dirs(parser);

    /* and the service helper */
    servicehelper = bus_config_parser_get_servicehelper(parser);

    s = _dbus_strdup(servicehelper);
    if (s == NULL && servicehelper != NULL)
    {
        BUS_SET_OOM(error);
        goto failed;
    }
    else
    {
        dbus_free(context->servicehelper);
        context->servicehelper = s;
    }

    /* Create activation subsystem */
    if (context->activation)
    {
        if (!bus_activation_reload(context->activation, &full_address, dirs,
                                   error))
            goto failed;
    }
    else
    {
        context->activation =
            bus_activation_new(context, &full_address, dirs, error);
    }

    if (context->activation == NULL)
    {
        _DBUS_ASSERT_ERROR_IS_SET(error);
        goto failed;
    }

    _DBUS_ASSERT_ERROR_IS_CLEAR(error);
    retval = TRUE;

failed:
    _dbus_string_free(&full_address);

    if (addr)
        dbus_free(addr);

    return retval;
}
/* This code gets executed every time the config files
 * are parsed: both during BusContext construction
 * and on reloads. This function is slightly screwy
 * since it can do a "half reload" in out-of-memory
 * situations. Realistically, unlikely to ever matter.
 */
This code gets executed every time the config files
are parsed: both during BusContext construction
and on reloads. This function is slightly screwy
since it can do a "half reload" in out-of-memory
situations. Realistically, unlikely to ever matter.
This code gets executed every time the config files are parsed : both during BusContext construction and on reloads . This function is slightly screwy since it can do a " half reload " in out - of - memory situations . Realistically unlikely to ever matter .
static dbus_bool_t process_config_every_time(BusContext* context,
                                             BusConfigParser* parser,
                                             dbus_bool_t is_reload,
                                             DBusError* error)
{
    DBusString full_address;
    DBusList* link;
    DBusList** dirs;
    char* addr;
    const char* servicehelper;
    char* s;
    dbus_bool_t retval;
    _DBUS_ASSERT_ERROR_IS_CLEAR(error);
    addr = NULL;
    retval = FALSE;
    if (!_dbus_string_init(&full_address))
    {
        BUS_SET_OOM(error);
        return FALSE;
    }
    bus_config_parser_get_limits(parser, &context->limits);
    if (context->policy)
        bus_policy_unref(context->policy);
    context->policy = bus_config_parser_steal_policy(parser);
    _dbus_assert(context->policy != NULL);
    if (context->connections)
    {
        _dbus_verbose("Reload policy rules for completed connections\n");
        retval = bus_connections_reload_policy(context->connections, error);
        if (!retval)
        {
            _DBUS_ASSERT_ERROR_IS_SET(error);
            goto failed;
        }
    }
    link = _dbus_list_get_last_link(&context->servers);
    while (link != NULL)
    {
        addr = dbus_server_get_address(link->data);
        if (addr == NULL)
        {
            BUS_SET_OOM(error);
            goto failed;
        }
        if (_dbus_string_get_length(&full_address) > 0)
        {
            if (!_dbus_string_append(&full_address, ";"))
            {
                BUS_SET_OOM(error);
                goto failed;
            }
        }
        if (!_dbus_string_append(&full_address, addr))
        {
            BUS_SET_OOM(error);
            goto failed;
        }
        dbus_free(addr);
        addr = NULL;
        link = _dbus_list_get_prev_link(&context->servers, link);
    }
    if (is_reload)
        dbus_free(context->address);
    if (!_dbus_string_copy_data(&full_address, &context->address))
    {
        BUS_SET_OOM(error);
        goto failed;
    }
    dirs = bus_config_parser_get_service_dirs(parser);
    servicehelper = bus_config_parser_get_servicehelper(parser);
    s = _dbus_strdup(servicehelper);
    if (s == NULL && servicehelper != NULL)
    {
        BUS_SET_OOM(error);
        goto failed;
    }
    else
    {
        dbus_free(context->servicehelper);
        context->servicehelper = s;
    }
    if (context->activation)
    {
        if (!bus_activation_reload(context->activation, &full_address, dirs,
                                   error))
            goto failed;
    }
    else
    {
        context->activation =
            bus_activation_new(context, &full_address, dirs, error);
    }
    if (context->activation == NULL)
    {
        _DBUS_ASSERT_ERROR_IS_SET(error);
        goto failed;
    }
    _DBUS_ASSERT_ERROR_IS_CLEAR(error);
    retval = TRUE;
failed:
    _dbus_string_free(&full_address);
    if (addr)
        dbus_free(addr);
    return retval;
}
static dbus_bool_t process_config_every_time ( BusContext * context , BusConfigParser * parser , dbus_bool_t is_reload , DBusError * error ) { DBusString full_address ; DBusList * link ; DBusList * * dirs ; char * addr ; const char * servicehelper ; char * s ; dbus_bool_t retval ; _DBUS_ASSERT_ERROR_IS_CLEAR ( error ) ; addr = NULL ; retval = FALSE ; if ( ! _dbus_string_init ( & full_address ) ) { BUS_SET_OOM ( error ) ; return FALSE ; } bus_config_parser_get_limits ( parser , & context -> limits ) ; if ( context -> policy ) bus_policy_unref ( context -> policy ) ; context -> policy = bus_config_parser_steal_policy ( parser ) ; _dbus_assert ( context -> policy != NULL ) ; if ( context -> connections ) { _dbus_verbose ( " \n " ) ; retval = bus_connections_reload_policy ( context -> connections , error ) ; if ( ! retval ) { _DBUS_ASSERT_ERROR_IS_SET ( error ) ; goto failed ; } } link = _dbus_list_get_last_link ( & context -> servers ) ; while ( link != NULL ) { addr = dbus_server_get_address ( link -> data ) ; if ( addr == NULL ) { BUS_SET_OOM ( error ) ; goto failed ; } if ( _dbus_string_get_length ( & full_address ) > 0 ) { if ( ! _dbus_string_append ( & full_address , " " ) ) { BUS_SET_OOM ( error ) ; goto failed ; } } if ( ! _dbus_string_append ( & full_address , addr ) ) { BUS_SET_OOM ( error ) ; goto failed ; } dbus_free ( addr ) ; addr = NULL ; link = _dbus_list_get_prev_link ( & context -> servers , link ) ; } if ( is_reload ) dbus_free ( context -> address ) ; if ( ! _dbus_string_copy_data ( & full_address , & context -> address ) ) { BUS_SET_OOM ( error ) ; goto failed ; } dirs = bus_config_parser_get_service_dirs ( parser ) ; servicehelper = bus_config_parser_get_servicehelper ( parser ) ; s = _dbus_strdup ( servicehelper ) ; if ( s == NULL && servicehelper != NULL ) { BUS_SET_OOM ( error ) ; goto failed ; } else { dbus_free ( context -> servicehelper ) ; context -> servicehelper = s ; } if ( context -> activation ) { if ( ! bus_activation_reload ( context -> activation , & full_address , dirs , error ) ) goto failed ; } else { context -> activation = bus_activation_new ( context , & full_address , dirs , error ) ; } if ( context -> activation == NULL ) { _DBUS_ASSERT_ERROR_IS_SET ( error ) ; goto failed ; } _DBUS_ASSERT_ERROR_IS_CLEAR ( error ) ; retval = TRUE ; failed : _dbus_string_free ( & full_address ) ; if ( addr ) dbus_free ( addr ) ; return retval ; }
This code gets executed every time the config files
 are parsed: both during BusContext construction
 and on reloads.
This code gets executed every time the config files are parsed : both during BusContext construction and on reloads .
/* get our limits and timeout lengths */ /* context->connections is NULL when creating new BusContext */ /* We have to build the address backward, so that
     * <listen> later in the config file have priority
     */ /* get the service directories */ /* and the service helper */ /* Create activation subsystem */