浏览代码

add error handler in dlopen.c

shaolin 12 年之前
父节点
当前提交
83751c63e3
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      components/libdl/dlopen.c

+ 6 - 1
components/libdl/dlopen.c

@@ -35,7 +35,12 @@ void* dlopen(const char *filename, int flags)
 		rt_snprintf(fullpath, strlen(def_path) + strlen(filename) + 2, 
 		rt_snprintf(fullpath, strlen(def_path) + strlen(filename) + 2, 
 			"%s/%s", def_path, filename);
 			"%s/%s", def_path, filename);
 	}
 	}
-	
+	else
+	{
+		rt_kprintf("use absolute path\n");
+		return RT_NULL;
+	}	
+
 	/* find in module list */
 	/* find in module list */
 	module = rt_module_find(fullpath);
 	module = rt_module_find(fullpath);