[asterisk-commits] russell: branch russell/events r103659 - /team/russell/events/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 13 11:38:53 CST 2008


Author: russell
Date: Wed Feb 13 11:38:52 2008
New Revision: 103659

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103659
Log:
only compile in and initialize the pieces of res_ais that i am using right now

Modified:
    team/russell/events/res/Makefile
    team/russell/events/res/res_ais.c

Modified: team/russell/events/res/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/events/res/Makefile?view=diff&rev=103659&r1=103658&r2=103659
==============================================================================
--- team/russell/events/res/Makefile (original)
+++ team/russell/events/res/Makefile Wed Feb 13 11:38:52 2008
@@ -35,7 +35,7 @@
 ael/ael.tab.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
 ael/ael.tab.o: ASTCFLAGS+=-I. -Iael -DYYENABLE_NLS=0
 
-$(if $(filter res_ais,$(EMBEDDED_MODS)),modules.link,res_ais.so): ais/amf.o ais/clm.o ais/evt.o ais/lck.o ais/ckpt.o
+$(if $(filter res_ais,$(EMBEDDED_MODS)),modules.link,res_ais.so): ais/clm.o ais/evt.o
 
 $(if $(filter res_snmp,$(EMBEDDED_MODS)),modules.link,res_snmp.so): snmp/agent.o
 

Modified: team/russell/events/res/res_ais.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/res/res_ais.c?view=diff&rev=103659&r1=103658&r2=103659
==============================================================================
--- team/russell/events/res/res_ais.c (original)
+++ team/russell/events/res/res_ais.c Wed Feb 13 11:38:52 2008
@@ -110,24 +110,10 @@
 
 static void *dispatch_thread_handler(void *data)
 {
-	SaSelectionObjectT amf_fd, ckpt_fd, clm_fd, evt_fd, lck_fd, max_fd;
+	SaSelectionObjectT clm_fd, evt_fd, max_fd;
 	int res;
 	fd_set read_fds;
 	SaAisErrorT ais_res;
-
-	ais_res = saAmfSelectionObjectGet(amf_handle, &amf_fd);
-	if (ais_res != SA_AIS_OK) {
-		ast_log(LOG_ERROR, "Failed to retrieve select fd for AMF.  "
-			"This module will not operate.\n");
-		return NULL;
-	}
-
-	ais_res = saCkptSelectionObjectGet(ckpt_handle, &ckpt_fd);
-	if (ais_res != SA_AIS_OK) {
-		ast_log(LOG_ERROR, "Failed to retrieve select fd for CKPT service.  "
-			"This module will not operate.\n");
-		return NULL;
-	}
 
 	ais_res = saClmSelectionObjectGet(clm_handle, &clm_fd);
 	if (ais_res != SA_AIS_OK) {
@@ -143,28 +129,12 @@
 		return NULL;
 	}
 
-	ais_res = saLckSelectionObjectGet(lck_handle, &lck_fd);
-	if (ais_res != SA_AIS_OK) {
-		ast_log(LOG_ERROR, "Failed to retrieve select fd for LCK service.  "
-			"This module will not operate.\n");
-		return NULL;
-	}
-
 	max_fd = clm_fd > evt_fd ? clm_fd : evt_fd;
-	if (ckpt_fd > max_fd)
-		max_fd = ckpt_fd;
-	if (lck_fd > max_fd)
-		max_fd = lck_fd;
-	if (amf_fd > max_fd)
-		max_fd = amf_fd;
 
 	while (!dispatch_thread.stop) {
 		FD_ZERO(&read_fds);
-		FD_SET(amf_fd,  &read_fds);
-		FD_SET(ckpt_fd, &read_fds);
 		FD_SET(clm_fd,  &read_fds);
 		FD_SET(evt_fd,  &read_fds);
-		FD_SET(lck_fd,  &read_fds);
 
 		res = ast_select(max_fd + 1, &read_fds, NULL, NULL, NULL);
 		if (res == -1 && errno != EINTR && errno != EAGAIN) {
@@ -173,16 +143,10 @@
 			break;
 		}
 
-		if (FD_ISSET(amf_fd,  &read_fds))
-			saAmfDispatch(amf_handle,   SA_DISPATCH_ALL);
-		if (FD_ISSET(ckpt_fd, &read_fds))
-			saCkptDispatch(ckpt_handle, SA_DISPATCH_ALL);
 		if (FD_ISSET(clm_fd,  &read_fds))
 			saClmDispatch(clm_handle,   SA_DISPATCH_ALL);
 		if (FD_ISSET(evt_fd,  &read_fds))
 			saEvtDispatch(evt_handle,   SA_DISPATCH_ALL);
-		if (FD_ISSET(lck_fd,  &read_fds))
-			saLckDispatch(lck_handle,   SA_DISPATCH_ALL);
 	}
 
 	return NULL;
@@ -190,20 +154,11 @@
 
 static int load_module(void)
 {
-	if (ast_ais_amf_load_module())
-		goto amf_failed;
-
-	if (ast_ais_ckpt_load_module())
-		goto ckpt_failed;
-
 	if (ast_ais_clm_load_module())
-		goto clm_failed;
+		goto return_error;
 
 	if (ast_ais_evt_load_module())
 		goto evt_failed;
-
-	if (ast_ais_lck_load_module())
-		goto lck_failed;
 
 	if (ast_pthread_create_background(&dispatch_thread.id, NULL, 
 		dispatch_thread_handler, NULL)) {
@@ -214,26 +169,17 @@
 	return AST_MODULE_LOAD_SUCCESS;
 
 dispatch_failed:
-	ast_ais_lck_unload_module();
-lck_failed:
 	ast_ais_evt_unload_module();
 evt_failed:
 	ast_ais_clm_unload_module();
-clm_failed:
-	ast_ais_ckpt_unload_module();
-ckpt_failed:
-	ast_ais_amf_unload_module();
-amf_failed:
+return_error:
 	return AST_MODULE_LOAD_DECLINE;
 }
 
 static int unload_module(void)
 {
-	ast_ais_amf_unload_module();
-	ast_ais_ckpt_unload_module();
 	ast_ais_clm_unload_module();
 	ast_ais_evt_unload_module();
-	ast_ais_lck_unload_module();
 
 	if (dispatch_thread.id != AST_PTHREADT_NULL) {
 		dispatch_thread.stop = 1;




More information about the asterisk-commits mailing list