summaryrefslogtreecommitdiff
path: root/components/dfs
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-11-30 05:36:25 +0000
committerbernard.xiong <[email protected]>2010-11-30 05:36:25 +0000
commit8ccfaa8eb709789c059c01b623344cc72288485a (patch)
tree8cf7afb91fd7ebf71bececcc108138af2634366e /components/dfs
parent90ce1ad2190c402c8ce669a7791a29cf125dfd86 (diff)
cleanup DFS_USING_WORKDIR code.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1152 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs')
-rw-r--r--components/dfs/src/dfs.c3
-rw-r--r--components/dfs/src/dfs_file.c7
2 files changed, 3 insertions, 7 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index d1ecda80eb..901e19823b 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -18,6 +18,8 @@
#include <dfs_config.h>
#include <dfs_file.h>
+#define NO_WORKING_DIR "system does not support working dir\n"
+
/* Global variables */
const struct dfs_filesystem_operation* filesystem_operation_table[DFS_FILESYSTEM_TYPES_MAX];
struct dfs_filesystem filesystem_table[DFS_FILESYSTEMS_MAX];
@@ -273,6 +275,7 @@ char* dfs_normalize_path(const char* directory, const char* filename)
#else
if ((directory == NULL) && (filename[0] != '/'))
{
+ rt_kprintf(NO_WORKING_DIR);
return RT_NULL;
}
#endif
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c
index fb6a7893da..5939cd680e 100644
--- a/components/dfs/src/dfs_file.c
+++ b/components/dfs/src/dfs_file.c
@@ -14,8 +14,6 @@
#include <dfs.h>
#include <dfs_file.h>
-#define NO_WORKING_DIR "system does not support working dir\n"
-
/**
* @addtogroup FileApi
*/
@@ -43,7 +41,6 @@ int dfs_file_open(struct dfs_fd* fd, const char *path, int flags)
fullpath = dfs_normalize_path(RT_NULL, path);
if (fullpath == RT_NULL)
{
- rt_kprintf(NO_WORKING_DIR);
return -1;
}
@@ -213,7 +210,6 @@ int dfs_file_unlink(const char *path)
fullpath = dfs_normalize_path(RT_NULL, path);
if ( fullpath == RT_NULL)
{
- rt_kprintf(NO_WORKING_DIR);
return -DFS_STATUS_EINVAL;
}
@@ -327,7 +323,6 @@ int dfs_file_stat(const char *path, struct stat *buf)
fullpath = dfs_normalize_path(RT_NULL, path);
if ( fullpath == RT_NULL )
{
- rt_kprintf(NO_WORKING_DIR);
return -1;
}
@@ -395,7 +390,6 @@ int dfs_file_rename(const char* oldpath, const char* newpath)
oldfullpath = dfs_normalize_path(RT_NULL, oldpath);
if ( oldfullpath == RT_NULL )
{
- rt_kprintf(NO_WORKING_DIR);
result = -DFS_STATUS_ENOENT;
goto __exit;
}
@@ -403,7 +397,6 @@ int dfs_file_rename(const char* oldpath, const char* newpath)
newfullpath = dfs_normalize_path(RT_NULL, newpath);
if ( newfullpath == RT_NULL )
{
- rt_kprintf(NO_WORKING_DIR);
result = -DFS_STATUS_ENOENT;
goto __exit;
}