return TRUE;
}
-int setting_invoke_reset_function(char *lib_name, service_h service, void *ext)
+int setting_invoke_reset_function(char *ug_name, service_h service, void *ext)
{
- SETTING_TRACE("Enter %s with lib_name:%s", __FUNCTION__, lib_name);
+ SETTING_TRACE("Enter %s with ug_name:%s", __FUNCTION__, ug_name);
int (*reset) (service_h pair, void *ptr);
int ret = OPERATE_LIB_SUCESS;
- void *handle = dlopen(lib_name, RTLD_LAZY);
+ //1.first do exist-checking in /opt/ug/lib
+ char ug_file[PATH_MAX + 1];
+ snprintf(ug_file, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH, ug_name);
+ struct stat st;
+ if(stat(ug_file, &st) != 0) {
+
+ //2.if it does not exit in /opt/ug/lib, then do exist-checking in /usr/ug/lib
+ memset(ug_file, 0x00, PATH_MAX + 1);
+ snprintf(ug_file, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH_USR, ug_name);
+ if(stat(ug_file, &st) != 0) {
+ //both not exist,skip it
+ SETTING_TRACE_ERROR(" libug-%s.so is *NOT* present, so skip it..\n", ug_name);
+ return OPERATE_LIB_SUCESS;
+ }
+ }
+ //-------------------------------------------------------------------------------------
+ void *handle = dlopen(ug_file, RTLD_LAZY);
if (!handle) {
SETTING_TRACE_ERROR(" >>>>>>>>>>> %s", dlerror());
return LOAD_LIB_FAILED;