summaryrefslogtreecommitdiff
path: root/filesystem/dfs/src
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2009-08-19 13:14:50 +0000
committerbernard.xiong <[email protected]>2009-08-19 13:14:50 +0000
commite00da562ed8cf940329ca9c6fbb8318164295762 (patch)
treeef17b40da4cfdb59039cdc766546becb9e823ac0 /filesystem/dfs/src
parent9eed317daf5c7ab54d14539535a75e7652e55b15 (diff)
update stm32 radio code; add backspace key support in finsh;
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@22 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'filesystem/dfs/src')
-rw-r--r--filesystem/dfs/src/dfs_raw.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/filesystem/dfs/src/dfs_raw.c b/filesystem/dfs/src/dfs_raw.c
index 816197c5e9..a3be0b6a13 100644
--- a/filesystem/dfs/src/dfs_raw.c
+++ b/filesystem/dfs/src/dfs_raw.c
@@ -38,7 +38,11 @@ int fd_new(void)
rt_sem_take(fd_table_lock, RT_WAITING_FOREVER);
/* find an empty fd entry */
+#ifdef RT_USING_STDIO
for (idx = 3; idx < DFS_FD_MAX && fd_table[idx].ref_count > 0; idx++);
+#else
+ for (idx = 0; idx < DFS_FD_MAX && fd_table[idx].ref_count > 0; idx++);
+#endif
/* can't find an empty fd entry */
if (idx == DFS_FD_MAX)
@@ -69,7 +73,11 @@ struct dfs_fd* fd_get(int fd)
{
struct dfs_fd* d;
+#ifdef RT_USING_STDIO
if ( fd < 3 || fd > DFS_FD_MAX ) return RT_NULL;
+#else
+ if ( fd < 0 || fd > DFS_FD_MAX ) return RT_NULL;
+#endif
d = &fd_table[fd];