You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2021/02/21 12:40:52 UTC

[incubator-nuttx] branch master updated: fs: Don't call _NX_SETERRNO in fopen and fdopen

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5f387be  fs: Don't call _NX_SETERRNO in fopen and fdopen
5f387be is described below

commit 5f387bebc61dd063d552f19ed1efd6569d8b3afb
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Feb 15 22:54:59 2021 +0800

    fs: Don't call _NX_SETERRNO in fopen and fdopen
    
    since fs_fdopen always return the error code directly
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 libs/libc/stdio/lib_fopen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libs/libc/stdio/lib_fopen.c b/libs/libc/stdio/lib_fopen.c
index e73743b..160c3e7 100644
--- a/libs/libc/stdio/lib_fopen.c
+++ b/libs/libc/stdio/lib_fopen.c
@@ -76,7 +76,7 @@ FAR FILE *fdopen(int fd, FAR const char *mode)
       ret = fs_fdopen(fd, oflags, NULL, &filep);
       if (ret < 0)
         {
-          _NX_SETERRNO(ret);
+          set_errno(-ret);
         }
     }
 
@@ -122,7 +122,7 @@ FAR FILE *fopen(FAR const char *path, FAR const char *mode)
 
           close(fd);
 
-          _NX_SETERRNO(ret);
+          set_errno(-ret);
           filep = NULL;
         }
     }