From d5afcd7f0de49c4df70fcd66aaaf6a62bf0413a6 Mon Sep 17 00:00:00 2001 From: "Man, Jianting (Meco)" <920369182@qq.com> Date: Tue, 21 Jun 2022 23:51:49 -0400 Subject: [PATCH] fix the error return (#6097) --- components/libc/compilers/armlibc/syscalls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index 82c0f38b4f..e1818dc90e 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -71,7 +71,7 @@ FILEHANDLE _sys_open(const char *name, int openmode) #ifndef DFS_USING_POSIX LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS); - return 0; /* error */ + return -1; /* error */ #else /* Correct openmode from fopen to open */ if (openmode & OPEN_PLUS) @@ -101,7 +101,7 @@ FILEHANDLE _sys_open(const char *name, int openmode) fd = open(name, mode, 0); if (fd < 0) - return 0; /* error */ + return -1; /* error */ else return fd; #endif /* DFS_USING_POSIX */ @@ -116,7 +116,7 @@ int _sys_close(FILEHANDLE fh) return close(fh); #else LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS); - return 0; + return 0; /* error */ #endif /* DFS_USING_POSIX */ }