} else if(res == 0) { crm_debug_2("%s: no reply expected", crm_system_name);
main(int argc, char **argv){	int option_index = 0;	int argerr = 0;	int flag;	ll_cluster_t *hb_cluster = NULL;	static struct option long_options[] = {		/* Top-level Options */		{"verbose", 0, 0, 'V'},		{"help", 0, 0, '?'},		{"quiet", 0, 0, 'q'},		{"reference", 1, 0, 0},		{XML_ATTR_TIMEOUT, 1, 0, 't'},		/* daemon options */		{"kill", 1, 0, 'K'},  /* stop a node */		{"die", 0, 0, 0},  /* kill a node, no respawn */		{"crm_debug_inc", 1, 0, 'i'},		{"crm_debug_dec", 1, 0, 'd'},		{"status", 1, 0, 'S'},		{"standby", 1, 0, 's'},		{"active", 1, 0, 'a'},		{"health", 0, 0, 'H'},		{"election", 0, 0, 'E'},		{"dc_lookup", 0, 0, 'D'},		{"resources", 0, 0, 'R'},		{"nodes", 0, 0, 'N'},		{"whereis", 1, 0, 'W'},		{"option", 1, 0, 'o'},		{0, 0, 0, 0}	};	crm_system_name = basename(argv[0]);	crm_log_level = 0;	crm_log_init(crm_system_name);	crm_log_level = 0;	if(argc < 2) {		usage(crm_system_name, LSB_EXIT_EINVAL);	}		while (1) {		flag = getopt_long(argc, argv, OPTARGS,				   long_options, &option_index);		if (flag == -1)			break;		switch(flag) {			case 0:				printf("option %s", long_options[option_index].name);				if (optarg)					printf(" with arg %s", optarg);				printf("\n");							if (strcmp("reference",					   long_options[option_index].name) == 0) {					this_msg_reference =						crm_strdup(optarg);				} else if (strcmp("die",						  long_options[option_index].name) == 0) {					DO_RESET = TRUE;					crmd_operation = CRM_OP_DIE;									} else {					printf( "?? Long option (--%s) is not yet properly supported ??\n",						long_options[option_index].name);					++argerr;				}				break;			/* a sample test for multiple instance   if (digit_optind != 0 && digit_optind != this_option_optind)   printf ("digits occur in two different argv-elements.\n");   digit_optind = this_option_optind;   printf ("option %c\n", c);*/						case 'V':				BE_VERBOSE = TRUE;				admin_verbose = XML_BOOLEAN_TRUE;				cl_log_enable_stderr(TRUE);				alter_debug(DEBUG_INC);				break;			case 't':				message_timeout_ms = atoi(optarg);				if(message_timeout_ms < 1) {					message_timeout_ms = 30*1000;				}				break;							case '?':				usage(crm_system_name, LSB_EXIT_OK);				break;			case 'D':				DO_WHOIS_DC = TRUE;				break;			case 'W':				DO_RESOURCE = TRUE;				crm_debug_2("Option %c => %s", flag, optarg);				rsc_name = crm_strdup(optarg);				break;			case 'K':				DO_RESET = TRUE;				crm_debug_2("Option %c => %s", flag, optarg);				dest_node = crm_strdup(optarg);				crmd_operation = CRM_OP_LOCAL_SHUTDOWN;				break;			case 'o':				DO_OPTION = TRUE;				crm_debug_2("Option %c => %s", flag, optarg);				crm_option = crm_strdup(optarg);				break;			case 'q':				BE_SILENT = TRUE;				break;			case 'i':				DO_DEBUG = debug_inc;				crm_debug_2("Option %c => %s", flag, optarg);				dest_node = crm_strdup(optarg);				break;			case 'd':				DO_DEBUG = debug_dec;				crm_debug_2("Option %c => %s", flag, optarg);				dest_node = crm_strdup(optarg);				break;			case 's':				DO_STANDBY = TRUE;				crm_debug_2("Option %c => %s", flag, optarg);				dest_node = crm_strdup(optarg);				break;			case 'a':				DO_STANDBY = TRUE;				crm_debug_2("Option %c => %s", flag, optarg);				dest_node = crm_strdup(optarg);				standby_on_off = "off";				break;			case 'S':				DO_HEALTH = TRUE;				crm_debug_2("Option %c => %s", flag, optarg);				dest_node = crm_strdup(optarg);				break;			case 'E':				DO_ELECT_DC = TRUE;				break;			case 'N':				DO_NODE_LIST = TRUE;				break;			case 'R':				DO_RESOURCE_LIST = TRUE;				break;			case 'H':				DO_HEALTH = TRUE;				break;			default:				printf("Argument code 0%o (%c) is not (?yet?) supported\n", flag, flag);				++argerr;				break;		}	}	if (optind < argc) {		printf("non-option ARGV-elements: ");		while (optind < argc)			printf("%s ", argv[optind++]);		printf("\n");	}	if (optind > argc) {		++argerr;	}	if (argerr) {		usage(crm_system_name, LSB_EXIT_GENERIC);	}	hb_cluster = do_init();	if (hb_cluster != NULL) {		int res = do_work(hb_cluster);		if (res > 0) {			/* wait for the reply by creating a mainloop and running it until			 * the callbacks are invoked...			 */			mainloop = g_main_new(FALSE);			crm_debug_2("%s waiting for reply from the local CRM",				 crm_system_name);			message_timer_id = Gmain_timeout_add(				message_timeout_ms, admin_message_timeout, NULL);						g_main_run(mainloop);			return_to_orig_privs();					} else if(res == 0) {			crm_debug_2("%s: no reply expected",				 crm_system_name);					} else {			crm_err("No message to send");			operation_status = -1;		}	} else {		crm_err("Init failed, could not perform requested operations");		operation_status = -2;	}	crm_debug_2("%s exiting normally", crm_system_name);	return operation_status;}