if (optarg)
if (optarg) {
main(int argc, char **argv){	int option_index = 0;	int argerr = 0;	int flag;	int level = 0;	int attempts = 0;		static struct option long_options[] = {		/* Top-level Options */		{"verbose",      0, 0, 'V'},		{"help",         0, 0, '?'},		{"pre",          0, 0, 'p'},		{"post",         0, 0, 'P'},		{"update",       0, 0, 'U'},		{"all",          0, 0, 'a'},		{"intermediate", 0, 0, 'i'},		{"max-conn-fail",1, 0, 'm'},		{0, 0, 0, 0}	};	/* Redirect messages from glib functions to our handler */	g_log_set_handler(NULL,			  G_LOG_LEVEL_ERROR      | G_LOG_LEVEL_CRITICAL			  | G_LOG_LEVEL_WARNING  | G_LOG_LEVEL_MESSAGE			  | G_LOG_LEVEL_INFO     | G_LOG_LEVEL_DEBUG			  | G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL,			  cl_glib_msg_handler, NULL);	/* and for good measure... */	g_log_set_always_fatal((GLogLevelFlags)0);    		cl_log_set_entity(crm_system_name);	cl_log_set_facility(LOG_LOCAL7);	cl_log_set_debugfile(DEVEL_DIR"/cibmon.debug");	cl_log_set_logfile(DEVEL_DIR"/cibmon.log");#ifdef USE_LIBXML	/* docs say only do this once, but in their code they do it every time! */	xmlInitParser(); #endif	msg_cibmon_strm = fopen(DEVEL_DIR"/cibmon.updates", "a");	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");		printf("Long option (--%s) is not (yet?) properly supported\n",		       long_options[option_index].name);		++argerr;			case 'V':				level = get_crm_log_level();				cl_log_enable_stderr(TRUE);				set_crm_log_level(level+1);				break;			case '?':				usage(crm_system_name, LSB_EXIT_OK);				break;			case 'm':				max_failures = crm_atoi(optarg, "30");				break;			case 'a':				pre_notify = TRUE;				post_notify = TRUE;				update_notify = TRUE;				break;			case 'p':				pre_notify = TRUE;				break;			case 'P':				post_notify = TRUE;				break;			case 'U':				update_notify = TRUE;				break;			case 'i':				intermediate_changes = 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);	}	the_cib = cib_new();	do {		if(attempts != 0) {			sleep(1);		}		exit_code = the_cib->cmds->signon(the_cib, cib_query);	} while(exit_code == cib_connection && attempts++ < max_failures);			if(exit_code != cib_ok) {		crm_err("Signon to CIB failed: %s",			cib_error2string(exit_code));		fprintf(stderr, "Signon to CIB failed: %s\n",			cib_error2string(exit_code));	} 	if(exit_code == cib_ok) {		exit_code = the_cib->cmds->set_connection_dnotify(			the_cib, cib_connection_destroy);	}		if(exit_code == cib_ok && pre_notify) {		exit_code = the_cib->cmds->add_notify_callback(			the_cib, T_CIB_PRE_NOTIFY, cibmon_pre_notify);				if(exit_code != cib_ok) {			crm_err("Failed to set %s callback: %s",				T_CIB_PRE_NOTIFY, cib_error2string(exit_code));			fprintf(stderr, "Failed to set %s callback: %s",				T_CIB_PRE_NOTIFY, cib_error2string(exit_code));		}	}	if(exit_code == cib_ok && post_notify) {		exit_code = the_cib->cmds->add_notify_callback(			the_cib, T_CIB_POST_NOTIFY, cibmon_post_notify);				if(exit_code != cib_ok) {			crm_err("Failed to set %s callback: %s",				T_CIB_POST_NOTIFY, cib_error2string(exit_code));			fprintf(stderr, "Failed to set %s callback: %s",				T_CIB_POST_NOTIFY, cib_error2string(exit_code));		}	}	if(exit_code == cib_ok && update_notify) {		exit_code = the_cib->cmds->add_notify_callback(			the_cib, T_CIB_UPDATE_CONFIRM, cibmon_update_confirm);				if(exit_code != cib_ok) {			crm_err("Failed to set %s callback: %s",				T_CIB_UPDATE_CONFIRM, cib_error2string(exit_code));			fprintf(stderr, "Failed to set %s callback: %s",				T_CIB_UPDATE_CONFIRM, cib_error2string(exit_code));		}	}		if(exit_code != cib_ok) {		crm_err("Setup failed, could not monitor CIB actions");		fprintf(stderr, "Setup failed, could not monitor CIB actions\n");		fflush(stderr);		fflush(stdout);		return -exit_code;	}	mainloop = g_main_new(FALSE);	crm_info("Starting mainloop");	g_main_run(mainloop);	crm_debug("%s exiting normally", crm_system_name);	fflush(stderr);	return -exit_code;}