return cpid;
exit(cpid);
fork_and_execra(const char * ra_name, const char * op, const char * cmd_params,		GHashTable * env_params, gboolean need_metadata){	int cpid;	int fd[2];		cl_log(LOG_DEBUG, "Will to execute RA %s.", ra_name);	if (need_metadata == TRUE) {		if ( pipe(fd) < 0 ) {			cl_log(LOG_ERR,"pipe create error when to execute %s.",				 ra_name);			exit(-1);		}	}	if ( (cpid=fork()) < 0 ) {		cl_log(LOG_ERR, "Fork failed when to execute %s.", ra_name);		exit(-1);	} 	if ( cpid > 0 ) {		/* In parent process */		/* close write fd */		if ( need_metadata == TRUE ) {			close(fd[1]);			g_hash_table_insert(post_query_ops, 				g_intdup(cpid), g_intdup(fd[0]));		}		else {			g_hash_table_insert(post_query_ops, 				g_intdup(cpid), g_intdup(0));		}		return cpid;	} else {		/* in child process */		/* close read fd */		cl_log(LOG_DEBUG, "In forked child %d.", getpid());		if ( need_metadata == TRUE ) {			close(fd[0]);			if ( fd[1] != STDOUT_FILENO ) {				if (dup2(fd[1], STDOUT_FILENO)!=STDOUT_FILENO) {					cl_log(LOG_ERR,"dup2 error when to "\						"execute RA.");					exit(-1);				}			}			close(fd[1]);		}		raexec_setenv(env_params);		if ( execl(ra_name, ra_name, op, NULL) < 0 ) {			cl_log(LOG_ERR, "execl error when to execute RA %s.", 				ra_name);		}		exit(-1);     	} }