Ejemplo n.º 1
0
int init_data(void)
{
	dp_head_p start, tmp = NULL;

	start = dp_hlist;
	if (!start) {
		LM_ERR("no partition defined, not even the default one!\n");
		return -1;
	}

	while (start) {
		LM_DBG("Adding partition with name [%.*s]\n",
				start->partition.len, start->partition.s);
		if (!dp_add_connection(start)) {
			LM_ERR("failed to initialize partition '%.*s'\n",
					start->partition.len, start->partition.s);
			return -1;
		}

		tmp   = start;
		start = start->next;
		pkg_free(tmp);
	}

	return 0;
}
Ejemplo n.º 2
0
int init_data(void)
{
	dp_head_p start, tmp = NULL; 

	for (start = dp_hlist ; start; start = start->next) {
		if(tmp)
			pkg_free(tmp);

		LM_DBG("Adding partition with name [%.*s]\n", 
				start->partition.len, start->partition.s);
		if (!dp_add_connection(start)) {
			LM_ERR("failed to initialize partition '%.*s'\n",
					start->partition.len, start->partition.s);
			return -1;
		}

		tmp = start;
	}
	pkg_free(tmp);

	return 0;
}