rem: if(xj_wlist_init_contact(jwl, contact) < 0) { DBG("XJAB:mod_init: error initializing workers list properties\n"); return -1; }
context: static int mod_init(void){	load_tm_f load_tm;//	load_im_f load_im;	int  i;	DBG("XJAB:mod_init: initializing ...\n");	/* import mysql functions */	if (bind_dbmod())	{		DBG("XJAB:mod_init: error - database module not found\n");		return -1;	}	db_con = (db_con_t**)shm_malloc(nrw*sizeof(db_con_t*));	if (db_con == NULL)	{		DBG("XJAB:mod_init: Error while allocating db_con's\n");		return -1;	}	/* import the TM auto-loading function */	if ( !(load_tm=(load_tm_f)find_export("load_tm", NO_SCRIPT))) {		LOG(L_ERR, "ERROR: xjab:mod_init: can't import load_tm\n");		return -1;	}	/* let the auto-loading function load all TM stuff */	if (load_tm( &tmb )==-1)		return -1;	pipes = (int**)pkg_malloc(nrw*sizeof(int*));	if (pipes == NULL)	{		DBG("XJAB:mod_init: Error while allocating pipes\n");		return -1;	}		for(i=0; i<nrw; i++)	{		pipes[i] = (int*)pkg_malloc(2*sizeof(int));		if (!pipes[i])		{			DBG("XJAB:mod_init: Error while allocating pipes\n");			return -1;		}	}		for(i=0; i<nrw; i++)	{		db_con[i] = db_init(db_url);		if (!db_con[i])		{			DBG("XJAB:mod_init: Error while connecting database\n");			return -1;		}		else		{			db_use_table(db_con[i], db_table);			DBG("XJAB:mod_init: Database connection opened successfuly\n");		}	}		/** creating the pipees */		for(i=0;i<nrw;i++)	{		/* create the pipe*/		if (pipe(pipes[i])==-1) {			DBG("XJAB:mod_init: error - cannot create pipe!\n");			return -1;		}		DBG("XJAB:mod_init: pipe[%d] = <%d>-<%d>\n", i, pipes[i][0],			pipes[i][1]);	}		if((jwl = xj_wlist_init(pipes,nrw,max_jobs,cache_time,sleep_time,				delay_time)) == NULL)	{		DBG("XJAB:mod_init: error initializing workers list\n");		return -1;	}		if(xj_wlist_init_contact(jwl, contact) < 0)	{		DBG("XJAB:mod_init: error initializing workers list properties\n");		return -1;	}	if(xj_wlist_set_aliases(jwl, jaliases, jdomain) < 0)	{		DBG("XJAB:mod_init: error setting aliases\n");		return -1;	}		DBG("XJAB:mod_init: initialized ...\n");		return 0;}