diff options
| author | Man, Jianting (Meco) <[email protected]> | 2022-06-21 23:51:49 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-06-22 11:51:49 +0800 |
| commit | d5afcd7f0de49c4df70fcd66aaaf6a62bf0413a6 (patch) | |
| tree | 153dc32d536a55353432074637978df0123c143c /components/libc | |
| parent | 7416f62c06cecc9f914343ea7ef2d83c95098b6e (diff) | |
fix the error return (#6097)
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/armlibc/syscalls.c | 6 |
1 files 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 */ } |
