rem: LOG(L_CRIT,"ERROR:cpl_init: mandatory parameter \"DB_TABLE\" "
add: LOG(L_CRIT,"ERROR:cpl_init: mandatory parameter \"cpl_table\" "
context: static int cpl_init(void){	bind_usrloc_t bind_usrloc;	load_tm_f     load_tm;	struct stat   stat_t;	char *ptr;	int val;	str foo;	LOG(L_INFO,"CPL - initializing\n");	/* check the module params */	if (DB_URL==0) {		LOG(L_CRIT,"ERROR:cpl_init: mandatory parameter \"DB_URL\" "			"found empty\n");		goto error;	}	if (DB_TABLE==0) {		LOG(L_CRIT,"ERROR:cpl_init: mandatory parameter \"DB_TABLE\" "			"found empty\n");		goto error;	}	if (cpl_env.proxy_recurse>MAX_PROXY_RECURSE) {		LOG(L_CRIT,"ERROR:cpl_init: value of proxy_recurse param (%d) exceeds "			"the maximum safety value (%d)\n",			cpl_env.proxy_recurse,MAX_PROXY_RECURSE);		goto error;	}	/* fix the timer_avp name */	if (timer_avp) {		foo.s = timer_avp;		foo.len = strlen(foo.s);		if (parse_avp_spec(&foo,&cpl_env.timer_avp_type,&cpl_env.timer_avp)<0){			LOG(L_CRIT,"ERROR:cpl_init: invalid timer AVP specs \"%s\"\n",				timer_avp);			goto error;		}		if (cpl_env.timer_avp_type&AVP_NAME_STR && cpl_env.timer_avp.s==&foo) {			if ( (cpl_env.timer_avp.s=(str*)pkg_malloc(sizeof(str)))==0 ) {				LOG(L_ERR, "ERROR:cpl_init: no more pkg mem\n");				goto error;			}			*(cpl_env.timer_avp.s) = foo;		}	}	if (dtd_file==0) {		LOG(L_CRIT,"ERROR:cpl_init: mandatory parameter \"cpl_dtd_file\" "			"found empty\n");		goto error;	} else {		/* check if the dtd file exists */		if (stat( dtd_file, &stat_t)==-1) {			LOG(L_ERR,"ERROR:cpl_init: checking file \"%s\" status failed;"				" stat returned %s\n",dtd_file,strerror(errno));			goto error;		}		if ( !S_ISREG( stat_t.st_mode ) ) {			LOG(L_ERR,"ERROR:cpl_init: dir \"%s\" is not a regular file!\n",				dtd_file);			goto error;		}		if (access( dtd_file, R_OK )==-1) {			LOG(L_ERR,"ERROR:cpl_init: checking file \"%s\" for permissions "				"failed; access returned %s\n",dtd_file,strerror(errno));			goto error;		}	}	if (cpl_env.log_dir==0) {		LOG(L_INFO,"INFO:cpl_init: log_dir param found void -> logging "			" disabled!\n");	} else {		if ( strlen(cpl_env.log_dir)>MAX_LOG_DIR_SIZE ) {			LOG(L_ERR,"ERROR:cpl_init: dir \"%s\" has a too long name :-(!\n",				cpl_env.log_dir);			goto error;		}		/* check if the dir exists */		if (stat( cpl_env.log_dir, &stat_t)==-1) {			LOG(L_ERR,"ERROR:cpl_init: checking dir \"%s\" status failed;"				" stat returned %s\n",cpl_env.log_dir,strerror(errno));			goto error;		}		if ( !S_ISDIR( stat_t.st_mode ) ) {			LOG(L_ERR,"ERROR:cpl_init: dir \"%s\" is not a directory!\n",				cpl_env.log_dir);			goto error;		}		if (access( cpl_env.log_dir, R_OK|W_OK )==-1) {			LOG(L_ERR,"ERROR:cpl_init: checking dir \"%s\" for permissions "				"failed; access returned %s\n",				cpl_env.log_dir, strerror(errno));			goto error;		}	}	/* bind to the mysql module */	if (cpl_db_bind(DB_URL)<0) goto error;	/* import the TM auto-loading function */	if ( !(load_tm=(load_tm_f)find_export("load_tm", NO_SCRIPT, 0))) {		LOG(L_ERR, "ERROR:cpl_c:cpl_init: cannot import load_tm\n");		goto error;	}	/* let the auto-loading function load all TM stuff */	if (load_tm( &(cpl_fct.tmb) )==-1)		goto error;	/* load the send_reply function from sl module */	if ((cpl_fct.sl_reply=find_export("sl_send_reply", 2, 0))==0) {		LOG(L_ERR, "ERROR:cpl_c:cpl_init: cannot import sl_send_reply; maybe "			"you forgot to load the sl module\n");		goto error;	}	/* bind to usrloc module if requested */	if (lookup_domain) {		/* import all usrloc functions */		bind_usrloc = (bind_usrloc_t)find_export("ul_bind_usrloc", 1, 0);		if (!bind_usrloc) {			LOG(L_ERR, "ERROR:cpl_c:cpl_init: Can't bind usrloc\n");			goto error;		}		if (bind_usrloc( &(cpl_fct.ulb) ) < 0) {			LOG(L_ERR, "ERROR:cpl_c:cpl_init: importing usrloc failed\n");			goto error;		}		/* convert lookup_domain from char* to udomain_t* pointer */		if (cpl_fct.ulb.register_udomain( lookup_domain, &cpl_env.lu_domain)		< 0) {			LOG(L_ERR, "ERROR:cpl_c:cpl_init: Error while registering domain "				"<%s>\n",lookup_domain);			goto error;		}	} else {		LOG(L_NOTICE,"NOTICE:cpl_init: no lookup_domain given -> disable "			" lookup node\n");	}	/* register the fifo commands */	if (register_fifo_cmd( cpl_load, "LOAD_CPL", 0)!=1) {		LOG(L_CRIT,"ERROR:cpl_init: cannot register LOAD_CPL fifo cmd!\n");		goto error;	}	if (register_fifo_cmd( cpl_remove, "REMOVE_CPL", 0)!=1) {		LOG(L_CRIT,"ERROR:cpl_init: cannot register REMOVE_CPL fifo cmd!\n");		goto error;	}	if (register_fifo_cmd( cpl_get, "GET_CPL", 0)!=1) {		LOG(L_CRIT,"ERROR:cpl_init: cannot register GET_CPL fifo cmd!\n");		goto error;	}	/* build a pipe for sending commands to aux process */	if ( pipe( cpl_env.cmd_pipe )==-1 ) {		LOG(L_CRIT,"ERROR:cpl_init: cannot create command pipe: %s!\n",			strerror(errno) );		goto error;	}	/* set the writing non blocking */	if ( (val=fcntl(cpl_env.cmd_pipe[1], F_GETFL, 0))<0 ) {		LOG(L_ERR,"ERROR:cpl_init: getting flags from pipe[1] failed: fcntl "			"said %s!\n",strerror(errno));		goto error;	}	if ( fcntl(cpl_env.cmd_pipe[1], F_SETFL, val|O_NONBLOCK) ) {		LOG(L_ERR,"ERROR:cpl_init: setting flags to pipe[1] failed: fcntl "			"said %s!\n",strerror(errno));		goto error;	}	/* init the CPL parser */	if (init_CPL_parser( dtd_file )!=1 ) {		LOG(L_ERR,"ERROR:cpl_init: init_CPL_parser failed!\n");		goto error;	}	/* make a copy of the original TZ env. variable */	ptr = getenv("TZ");	cpl_env.orig_tz.len = 3/*"TZ="*/ + (ptr?(strlen(ptr)+1):0);	if ( (cpl_env.orig_tz.s=shm_malloc( cpl_env.orig_tz.len ))==0 ) {		LOG(L_ERR,"ERROR:cpl_init: no more shm mem. for saving TZ!\n");		goto error;	}	memcpy(cpl_env.orig_tz.s,"TZ=",3);	if (ptr)		strcpy(cpl_env.orig_tz.s+3,ptr);	/* convert realm_prefix from string null terminated to str */	if (cpl_env.realm_prefix.s) {		cpl_env.realm_prefix.len = strlen(cpl_env.realm_prefix.s);		/* convert the realm_prefix to lower cases */		strlower( &cpl_env.realm_prefix );	}	return 0;error:	return -1;}