提交 2fc3db65 编写于 作者: B Bernard Xiong

Merge pull request #353 from grissiom/misc-fix

Misc fix
......@@ -335,6 +335,9 @@ int dfs_file_lseek(struct dfs_fd *fd, rt_off_t offset)
if (fd == RT_NULL)
return -DFS_STATUS_EINVAL;
fs = fd->fs;
if (fs == RT_NULL)
return -DFS_STATUS_EINVAL;
if (fs->ops->lseek == RT_NULL)
return -DFS_STATUS_ENOSYS;
......
......@@ -358,6 +358,9 @@ void msh_auto_complete_path(char *path)
struct dirent *dirent = RT_NULL;
char *full_path, *ptr, *index;
if (!path)
return;
full_path = (char*)rt_malloc(256);
if (full_path == RT_NULL) return; /* out of memory */
......
......@@ -276,6 +276,7 @@ int cmd_time(int argc, char** argv)
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_time, __cmd_time, Execute command with time.);
#ifdef RT_USING_HEAP
int cmd_free(int argc, char** argv)
{
extern void list_mem(void);
......@@ -284,6 +285,7 @@ int cmd_free(int argc, char** argv)
return 0;
}
FINSH_FUNCTION_EXPORT_ALIAS(cmd_free, __cmd_free, Show the memory usage in the system.);
#endif
#endif
......@@ -54,6 +54,7 @@ long int atol(const char* s)
return sign?-v:v;
}
#ifdef RT_USING_HEAP
void *malloc(size_t size)
{
return rt_malloc(size);
......@@ -73,5 +74,6 @@ void *calloc(size_t nelem, size_t elsize)
{
return rt_calloc(nelem, elsize);
}
#endif
#endif
......@@ -293,7 +293,7 @@ RTM_EXPORT(rt_timer_delete);
*/
rt_err_t rt_timer_start(rt_timer_t timer)
{
int row_lvl;
unsigned int row_lvl;
rt_list_t *timer_list;
register rt_base_t level;
rt_list_t *row_head[RT_TIMER_SKIP_LIST_LEVEL];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册