rem: if(xj_wlist_set_pids(jwl, pids, nrw) < 0) { DBG("XJAB:child_init: error setting pid's\n"); return -1; } if(pids) pkg_free(pids);
context: static int child_init(int rank){	int i;	int *pids = NULL;		DBG("XJAB:child_init: initializing child <%d>\n", rank);	if(rank == 0)	{		pids = (int*)pkg_malloc(nrw*sizeof(int));		if (pids == NULL)		{			DBG("XJAB:child_init: error while allocating pid's\n");			return -1;		}		/** launching the workers */		for(i=0;i<nrw;i++)		{			if ( (pids[i]=fork())<0 )			{				DBG("XJAB:child_init: error - cannot launch worker\n");				return -1;			}			if (pids[i] == 0)			{				close(pipes[i][1]);				xj_worker_process(jwl,jaddress,jport,pipes[i][0],db_con[i]);				exit(0);			}		}			if(xj_wlist_set_pids(jwl, pids, nrw) < 0)		{			DBG("XJAB:child_init: error setting pid's\n");			return -1;		}		if(pids)			pkg_free(pids);	}		if(pipes)	{		for(i=0;i<nrw;i++)			close(pipes[i][0]);	}	return 0;}