From 8431c056350aed7f234a5e463a3e786b2c7ac66a Mon Sep 17 00:00:00 2001 From: zylx Date: Sat, 13 Oct 2018 10:18:10 +0800 Subject: [PATCH] [dfs] fix ioctl getflag/setflag issue. --- components/dfs/src/dfs_file.c | 2 +- components/dfs/src/dfs_posix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dfs/src/dfs_file.c b/components/dfs/src/dfs_file.c index c437b43829..76cf419c0a 100644 --- a/components/dfs/src/dfs_file.c +++ b/components/dfs/src/dfs_file.c @@ -189,7 +189,7 @@ int dfs_file_ioctl(struct dfs_fd *fd, int cmd, void *args) int mask = O_NONBLOCK | O_APPEND; flags &= mask; - fd->flags &= mask; + fd->flags &= ~mask; fd->flags |= flags; } return 0; diff --git a/components/dfs/src/dfs_posix.c b/components/dfs/src/dfs_posix.c index 3d863c4f98..898488a2aa 100644 --- a/components/dfs/src/dfs_posix.c +++ b/components/dfs/src/dfs_posix.c @@ -455,7 +455,7 @@ int fcntl(int fildes, int cmd, ...) ret = -1; } - return 0; + return ret; } RTM_EXPORT(fcntl); -- GitLab