stonithd_receive_ops_result(TRUE);
if (ST_OK != stonithd_receive_ops_result(TRUE)) { cl_log(LOG_ERR, "stonithd_receive_ops_result failed.");  stonithd_signoff(); exit(EXECRA_EXEC_UNKNOWN_ERROR); }
execra(const char * rsc_id, const char * rsc_type, const char * provider,       const char * op_type,const int timeout, GHashTable * params){	stonithRA_ops_t * op;	int call_id = -1;	gboolean signedon_locally = FALSE;	if (signedon_to_stonithd == FALSE) {		if (ST_OK != stonithd_signon("STONITH_RA_EXEC")) {			cl_log(LOG_ERR, "Can not signon to the stonithd.");			exit(EXECRA_UNKNOWN_ERROR);		} else {			/* 			 * Since this function will be called in a child			 * process, actually this assignment is useless			 * and harmless. Remain it for an apparent logic.			 */			signedon_to_stonithd = TRUE;			signedon_locally = TRUE;		}	}	/*	 * Now handle "meta-data" operation locally. 	 * Should be changed in the future?	 */	if (strncmp(op_type, "meta-data", strlen("meta-data")) == 0) {		char * tmp;		tmp = get_resource_meta(rsc_type, provider);		printf("%s", tmp);		g_free(tmp);		if (signedon_locally == TRUE) {			stonithd_signoff();			signedon_locally = FALSE;		}		exit(0);	}	stonithd_set_stonithRA_ops_callback(stonithRA_ops_callback, &call_id);	/* Temporarily donnot use it, but how to deal with the global OCF 	 * variables. This is a important thing to think about and do.	 */	/* send the RA operation to stonithd to simulate a RA's actions */	cl_log(LOG_DEBUG, "Will send the stonith RA operation to stonithd: " \		"%s %s", rsc_type, op_type);	op = g_new(stonithRA_ops_t, 1);	op->ra_name = g_strdup(rsc_type);	op->op_type = g_strdup(op_type);	op->params = params;	op->rsc_id = g_strdup(rsc_id);	if (ST_FAIL == stonithd_virtual_stonithRA_ops(op, &call_id)) {		cl_log(LOG_DEBUG, "sending stonithRA op to stonithd failed.");		/* Need to improve the granularity for error return code */		if (signedon_locally == TRUE) {			stonithd_signoff();			signedon_locally = FALSE;		}		exit(EXECRA_EXEC_UNKNOWN_ERROR);	}	cl_log(LOG_DEBUG, "Waiting until the final result returned.");	/* May be redundant */	while (stonithd_op_result_ready() != TRUE) {		;	}	cl_log(LOG_DEBUG, "Will call stonithd_receive_ops_result.");	stonithd_receive_ops_result(TRUE);	/* exit_value will be setted by the callback function */	g_free(op->ra_name);	g_free(op->op_type);	g_free(op->rsc_id);	g_free(op);	if (signedon_locally == TRUE) {		stonithd_signoff();		signedon_locally = FALSE;	}	cl_log(LOG_DEBUG, "stonithRA orignal exit code=%d", exit_value);	exit(map_ra_retvalue(exit_value, op_type));}