openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/nbd/3.19-r0/nbd-3.19/nbd-server.c
static int append_new_servers(GArray* const servers, GError** const gerror)
{
    int i;
    GArray* new_servers;
    const int old_len = servers->len;
    int retval = -1;
    struct generic_conf genconf;

    new_servers = parse_cfile(config_file_pos, &genconf, true, gerror);
    g_thread_pool_set_max_threads(tpool, genconf.threads, NULL);
    if (!new_servers)
        goto out;

    for (i = 0; i < new_servers->len; ++i)
    {
        SERVER new_server = g_array_index(new_servers, SERVER, i);

        if (new_server.servename &&
            -1 == get_index_by_servename(new_server.servename, servers))
        {
            g_array_append_val(servers, new_server);
        }
    }

    retval = servers->len - old_len;
out:
    g_array_free(new_servers, TRUE);

    return retval;
}
/**
 * Parse configuration files and add servers to the array if they don't
 * already exist there. The existence is tested by comparing
 * servenames. A server is appended to the array only if its servename
 * is unique among all other servers.
 *
 * @param servers an array of servers
 * @return the number of new servers appended to the array, or -1 in
 *         case of an error
 **/
Parse configuration files and add servers to the array if they don't
already exist there. The existence is tested by comparing
servenames. A server is appended to the array only if its servename
is unique among all other servers.

@param servers an array of servers
@return the number of new servers appended to the array, or -1 in
case of an error
Parse configuration files and add servers to the array if they don ' t already exist there . The existence is tested by comparing servenames . A server is appended to the array only if its servename is unique among all other servers . @param servers an array of servers @return the number of new servers appended to the array or - 1 in case of an error
static int append_new_servers(GArray* const servers, GError** const gerror)
{
    int i;
    GArray* new_servers;
    const int old_len = servers->len;
    int retval = -1;
    struct generic_conf genconf;
    new_servers = parse_cfile(config_file_pos, &genconf, true, gerror);
    g_thread_pool_set_max_threads(tpool, genconf.threads, NULL);
    if (!new_servers)
        goto out;
    for (i = 0; i < new_servers->len; ++i)
    {
        SERVER new_server = g_array_index(new_servers, SERVER, i);
        if (new_server.servename &&
            -1 == get_index_by_servename(new_server.servename, servers))
        {
            g_array_append_val(servers, new_server);
        }
    }
    retval = servers->len - old_len;
out:
    g_array_free(new_servers, TRUE);
    return retval;
}
static int append_new_servers ( GArray * const servers , GError * * const gerror ) { int i ; GArray * new_servers ; const int old_len = servers -> len ; int retval = -1 ; struct generic_conf genconf ; new_servers = parse_cfile ( config_file_pos , & genconf , true , gerror ) ; g_thread_pool_set_max_threads ( tpool , genconf . threads , NULL ) ; if ( ! new_servers ) goto out ; for ( i = 0 ; i < new_servers -> len ; ++ i ) { SERVER new_server = g_array_index ( new_servers , SERVER , i ) ; if ( new_server . servename && -1 == get_index_by_servename ( new_server . servename , servers ) ) { g_array_append_val ( servers , new_server ) ; } } retval = servers -> len - old_len ; out : g_array_free ( new_servers , TRUE ) ; return retval ; }
Parse configuration files and add servers to the array if they don't
 already exist there.
Parse configuration files and add servers to the array if they don ' t already exist there .