This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 5eefe8609cfe276f7e1573f484bd98b58bc41025
Author: Yoshinori Sugino <ysgn0...@gmail.com>
AuthorDate: Wed Sep 16 16:53:56 2020 +0900

    fs/vfs/fs_ioctl.c: Call F_GETFD to avoid clear other flag we will add in 
the future
---
 fs/vfs/fs_ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/vfs/fs_ioctl.c b/fs/vfs/fs_ioctl.c
index 5f549da..3a4126a 100644
--- a/fs/vfs/fs_ioctl.c
+++ b/fs/vfs/fs_ioctl.c
@@ -195,10 +195,10 @@ int nx_vioctl(int fd, int req, va_list ap)
               }
             break;
           case FIOCLEX:
-            ret = nx_fcntl(fd, F_SETFD, FD_CLOEXEC);
+            ret = nx_fcntl(fd, F_SETFD, nx_fcntl(fd, F_GETFD) | FD_CLOEXEC);
             break;
           case FIONCLEX:
-            ret = nx_fcntl(fd, F_SETFD, 0);
+            ret = nx_fcntl(fd, F_SETFD, nx_fcntl(fd, F_GETFD) & ~FD_CLOEXEC);
             break;
         }
     }

Reply via email to