From 5f387bebc61dd063d552f19ed1efd6569d8b3afb Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 15 Feb 2021 22:54:59 +0800 Subject: [PATCH] fs: Don't call _NX_SETERRNO in fopen and fdopen since fs_fdopen always return the error code directly Signed-off-by: Xiang Xiao --- 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 e73743b4345..160c3e764a9 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; } }