Skip to content

Commit d5afcd7

Browse files
authored
fix the error return (#6097)
1 parent 7416f62 commit d5afcd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/libc/compilers/armlibc/syscalls.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ FILEHANDLE _sys_open(const char *name, int openmode)
7171

7272
#ifndef DFS_USING_POSIX
7373
LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS);
74-
return 0; /* error */
74+
return -1; /* error */
7575
#else
7676
/* Correct openmode from fopen to open */
7777
if (openmode & OPEN_PLUS)
@@ -101,7 +101,7 @@ FILEHANDLE _sys_open(const char *name, int openmode)
101101

102102
fd = open(name, mode, 0);
103103
if (fd < 0)
104-
return 0; /* error */
104+
return -1; /* error */
105105
else
106106
return fd;
107107
#endif /* DFS_USING_POSIX */
@@ -116,7 +116,7 @@ int _sys_close(FILEHANDLE fh)
116116
return close(fh);
117117
#else
118118
LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS);
119-
return 0;
119+
return 0; /* error */
120120
#endif /* DFS_USING_POSIX */
121121
}
122122

0 commit comments

Comments
 (0)