[Freeswitch-svn] [commit] r10412 - freeswitch/trunk/src

FreeSWITCH SVN mikej at freeswitch.org
Fri Nov 14 16:33:01 PST 2008


Author: mikej
Date: Fri Nov 14 19:32:58 2008
New Revision: 10412

Log:
clean up error message handling in module loader process.

Modified:
   freeswitch/trunk/src/switch_loadable_module.c

Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c	(original)
+++ freeswitch/trunk/src/switch_loadable_module.c	Fri Nov 14 19:32:58 2008
@@ -870,7 +870,7 @@
 	char *path;
 	char *file, *dot;
 	switch_loadable_module_t *new_module = NULL;
-	switch_status_t status;
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
 
 #ifdef WIN32
 	const char *ext = ".dll";
@@ -878,8 +878,10 @@
 	const char *ext = ".so";
 #endif
 
+	*err = "";
 
 	if ((file = switch_core_strdup(loadable_modules.pool, fname)) == 0) {
+		*err = "allocation error";
 		return SWITCH_STATUS_FALSE;
 	}
 
@@ -910,7 +912,11 @@
 			if (new_module->switch_module_runtime) {
 				switch_core_launch_thread(switch_loadable_module_exec, new_module, new_module->pool);
 			}
+		} else if (status != SWITCH_STATUS_SUCCESS) {
+			*err = "module load routine returned an error";
 		}
+	} else {
+		*err = "module load file routine returned an error";
 	}
 	switch_mutex_unlock(loadable_modules.mutex);
 



More information about the Freeswitch-svn mailing list