summaryrefslogtreecommitdiff
path: root/components/dfs/src
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-01-21 18:17:51 +0800
committerGitHub <[email protected]>2019-01-21 18:17:51 +0800
commitdfebb30c91875c52f16fd4e7bb9e5981fd0512b4 (patch)
treea5963a4d33a40b9286a6cfc0fc948751e66bb5b1 /components/dfs/src
parent3dd0ebe6e7d8d0ad7605269ef8fffd66a8029931 (diff)
parentb7996af1862800b80c756329dcbf1a8496651a81 (diff)
Merge pull request #2238 from armink/lts-v3.1.x
Sync from master latest version.
Diffstat (limited to 'components/dfs/src')
-rw-r--r--components/dfs/src/dfs.c6
-rw-r--r--components/dfs/src/dfs_file.c5
-rw-r--r--components/dfs/src/poll.c2
3 files changed, 7 insertions, 6 deletions
diff --git a/components/dfs/src/dfs.c b/components/dfs/src/dfs.c
index 12ae8e9d95..066c800568 100644
--- a/components/dfs/src/dfs.c
+++ b/components/dfs/src/dfs.c
@@ -18,7 +18,7 @@
#include <lwp.h>
#endif
-#ifdef RT_USING_DFS_DEVFS
+#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_POSIX)
#include <libc.h>
#endif
@@ -216,7 +216,7 @@ struct dfs_fd *fd_get(int fd)
struct dfs_fd *d;
struct dfs_fdtable *fdt;
-#ifdef RT_USING_DFS_DEVFS
+#if defined(RT_USING_DFS_DEVFS) && defined(RT_USING_POSIX)
if ((0 <= fd) && (fd <= 2))
fd = libc_stdio_get_console();
#endif
@@ -320,7 +320,7 @@ int fd_is_open(const char *pathname)
fd = fdt->fds[index];
if (fd == NULL || fd->fops == NULL || fd->path == NULL) continue;
- if (fd->fops == fs->ops->fops && strcmp(fd->path, mountpath) == 0)
+ if (fd->fs == fs && strcmp(fd->path, mountpath) == 0)
{
/* found file in file descriptor table */
rt_free(fullpath);
diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c
index 646ae58e36..4505667738 100644
--- a/components/dfs/src/dfs_file.c
+++ b/components/dfs/src/dfs_file.c
@@ -66,7 +66,8 @@ int dfs_file_open(struct dfs_fd *fd, const char *path, int flags)
}
LOG_D("open in filesystem:%s", fs->ops->name);
- fd->fops = fs->ops->fops; /* set file ops */
+ fd->fs = fs; /* set file system */
+ fd->fops = fs->ops->fops; /* set file ops */
/* initialize the fd item */
fd->type = FT_REGULAR;
@@ -171,7 +172,7 @@ int dfs_file_ioctl(struct dfs_fd *fd, int cmd, void *args)
return fd->flags; /* return flags */
case F_SETFL:
{
- int flags = (int)args;
+ int flags = (int)(rt_base_t)args;
int mask = O_NONBLOCK | O_APPEND;
flags &= mask;
diff --git a/components/dfs/src/poll.c b/components/dfs/src/poll.c
index 6655a8a667..6f83762082 100644
--- a/components/dfs/src/poll.c
+++ b/components/dfs/src/poll.c
@@ -40,7 +40,7 @@ static int __wqueue_pollwake(struct rt_wqueue_node *wait, void *key)
{
struct rt_poll_node *pn;
- if (key && !((rt_uint32_t)key & wait->key))
+ if (key && !((rt_ubase_t)key & wait->key))
return -1;
pn = rt_container_of(wait, struct rt_poll_node, wqn);