Explorar o código

[dfs] fix ioctl getflag/setflag issue.

zylx %!s(int64=6) %!d(string=hai) anos
pai
achega
8431c05635
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      components/dfs/src/dfs_file.c
  2. 1 1
      components/dfs/src/dfs_posix.c

+ 1 - 1
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;

+ 1 - 1
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);