You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/09/16 09:31:53 UTC

[incubator-nuttx] branch master updated (6584bfa -> 5eefe86)

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

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


    from 6584bfa  fs: Add static to stat_recursive
     new d4ec1ab  fs/vfs/fs_ioctl.c: Add FIOCLEX/FIONCLEX support
     new 5eefe86  fs/vfs/fs_ioctl.c: Call F_GETFD to avoid clear other flag we will add in the future

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 fs/vfs/fs_ioctl.c        | 6 ++++++
 include/nuttx/fs/ioctl.h | 6 ++++++
 2 files changed, 12 insertions(+)


[incubator-nuttx] 01/02: fs/vfs/fs_ioctl.c: Add FIOCLEX/FIONCLEX support

Posted by xi...@apache.org.
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 d4ec1ababd275b78da660aad6bd901159daf03bc
Author: Yoshinori Sugino <ys...@gmail.com>
AuthorDate: Wed Sep 16 14:04:20 2020 +0900

    fs/vfs/fs_ioctl.c: Add FIOCLEX/FIONCLEX support
---
 fs/vfs/fs_ioctl.c        | 6 ++++++
 include/nuttx/fs/ioctl.h | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/fs/vfs/fs_ioctl.c b/fs/vfs/fs_ioctl.c
index b55c9ed..5f549da 100644
--- a/fs/vfs/fs_ioctl.c
+++ b/fs/vfs/fs_ioctl.c
@@ -194,6 +194,12 @@ int nx_vioctl(int fd, int req, va_list ap)
                                nx_fcntl(fd, F_GETFL) & ~O_NONBLOCK);
               }
             break;
+          case FIOCLEX:
+            ret = nx_fcntl(fd, F_SETFD, FD_CLOEXEC);
+            break;
+          case FIONCLEX:
+            ret = nx_fcntl(fd, F_SETFD, 0);
+            break;
         }
     }
 
diff --git a/include/nuttx/fs/ioctl.h b/include/nuttx/fs/ioctl.h
index 42ccff7..7397b96 100644
--- a/include/nuttx/fs/ioctl.h
+++ b/include/nuttx/fs/ioctl.h
@@ -184,6 +184,12 @@
                                            * OUT: Integer that contains device
                                            *      minor number
                                            */
+#define FIOCLEX         _FIOC(0x000d)     /* IN:  None
+                                           * OUT: None
+                                           */
+#define FIONCLEX        _FIOC(0x000e)     /* IN:  None
+                                           * OUT: None
+                                           */
 
 /* NuttX file system ioctl definitions **************************************/
 


[incubator-nuttx] 02/02: fs/vfs/fs_ioctl.c: Call F_GETFD to avoid clear other flag we will add in the future

Posted by xi...@apache.org.
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 <ys...@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;
         }
     }