crm_malloc(action, sizeof(action_t)); if(action != NULL) { action->id   = action_id++; action->rsc  = rsc; action->task = task; action->node = on_node; 
} else if(task == start_rsc && action->runnable) { rsc->starting = TRUE; 
action_new(resource_t *rsc, enum action_tasks task,	   const char *timeout, node_t *on_node){	action_t *action = NULL;	GListPtr possible_matches = NULL;	if(rsc != NULL && task != monitor_rsc) {		possible_matches =			find_actions(rsc->actions, task, on_node);	}	if(possible_matches != NULL) {		if(g_list_length(possible_matches) > 1) {			crm_warn("Action %s for %s on %s exists %d times",				task2text(task), rsc?rsc->id:"<NULL>",				on_node?on_node->details->id:"<NULL>",				g_list_length(possible_matches));		}				action = g_list_nth_data(possible_matches, 0);		crm_devel("Returning existing action (%d) %s for %s on %s",			  action->id,			  task2text(task), rsc?rsc->id:"<NULL>",			  on_node?on_node->details->id:"<NULL>");		/* todo: free possible_matches */		return action;	}	if(timeout == NULL && rsc != NULL) {		timeout = find_action_timeout(rsc, task);	}		crm_devel("Creating action %s for %s on %s",		  task2text(task), rsc?rsc->id:"<NULL>",		  on_node?on_node->details->id:"<NULL>");	crm_malloc(action, sizeof(action_t));	if(action != NULL) {		action->id   = action_id++;		action->rsc  = rsc;		action->task = task;		action->node = on_node;		action->actions_before   = NULL;		action->actions_after    = NULL;		action->failure_is_fatal = TRUE;		action->pseudo     = FALSE;		action->dumped     = FALSE;		action->runnable   = TRUE;		action->processed  = FALSE;		action->optional   = FALSE;		action->seen_count = 0;		action->extra	   = g_hash_table_new_full(			g_str_hash, g_str_equal,			g_hash_destroy_str, g_hash_destroy_str);		if(timeout != NULL) {			add_hash_param(action->extra, "timeout", timeout);		}				if(rsc != NULL) {			if(on_node != NULL && !(on_node->details->online)) {				crm_warn("Action %s for %s is unrunnable:"					 " %s is offline",					 task2text(task), rsc?rsc->id:"<NULL>",					 on_node->details->id);				action->runnable = FALSE;			}						crm_devel("Adding created action to its resource");			rsc->actions = g_list_append(rsc->actions, action);			if(task == start_rsc) {				rsc->starting = TRUE;			} else if(task == stop_rsc) {				rsc->stopping = TRUE;			}					}	}	crm_devel("Action %d created", action->id);	global_action_list = g_list_append(global_action_list, action);	return action;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/c8f7d0f4911ea3659cf3484cbce5d92cafbc54dd/utils.c/buggy/crm/pengine/utils.c