summaryrefslogtreecommitdiff
path: root/components/dfs
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-12-29 16:55:23 +0000
committer[email protected] <[email protected]>2012-12-29 16:55:23 +0000
commitfd07f30f511335f506ae6557e300093d4dde421e (patch)
tree57ef6b2c4204d5083cfbf35379e007de9b1ffaba /components/dfs
parent42090544fc64fd11b78b6ce42d0150b123104224 (diff)
fix path bug and file/dir mode bug in dfs_nfs.c
now we can create file or directory on NFS server both with FreeNFS on windows and nfs-server on linux git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2556 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/dfs')
-rw-r--r--components/dfs/filesystems/nfs/dfs_nfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/dfs/filesystems/nfs/dfs_nfs.c b/components/dfs/filesystems/nfs/dfs_nfs.c
index ee02cbedb0..a7aa1cb208 100644
--- a/components/dfs/filesystems/nfs/dfs_nfs.c
+++ b/components/dfs/filesystems/nfs/dfs_nfs.c
@@ -214,7 +214,7 @@ static nfs_fh3 *get_dir_handle(struct nfs_filesystem *nfs, const char *name)
copy_handle(handle, &nfs->current_handle);
}
- while ((file = strtok_r(RT_NULL, "/", &path)) != RT_NULL && path[0] != '\0')
+ while ((file = strtok_r(RT_NULL, "/", &path)) != RT_NULL && path != RT_NULL)
{
LOOKUP3args args;
LOOKUP3res res;
@@ -718,7 +718,7 @@ int nfs_open(struct dfs_fd *file)
if (file->flags & DFS_O_CREAT)
{
- if (nfs_mkdir(nfs, file->path, 555) < 0)
+ if (nfs_mkdir(nfs, file->path, 0755) < 0)
return -1;
}
@@ -734,7 +734,7 @@ int nfs_open(struct dfs_fd *file)
/* create file */
if (file->flags & DFS_O_CREAT)
{
- if (nfs_create(nfs, file->path, 555) < 0) return -1;
+ if (nfs_create(nfs, file->path, 0664) < 0) return -1;
}
/* open file (get file handle ) */