mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-20 05:25:04 +08:00
fix the error return (#6097)
This commit is contained in:

committed by
GitHub

parent
7416f62c06
commit
d5afcd7f0d
@@ -71,7 +71,7 @@ FILEHANDLE _sys_open(const char *name, int openmode)
|
|||||||
|
|
||||||
#ifndef DFS_USING_POSIX
|
#ifndef DFS_USING_POSIX
|
||||||
LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS);
|
LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS);
|
||||||
return 0; /* error */
|
return -1; /* error */
|
||||||
#else
|
#else
|
||||||
/* Correct openmode from fopen to open */
|
/* Correct openmode from fopen to open */
|
||||||
if (openmode & OPEN_PLUS)
|
if (openmode & OPEN_PLUS)
|
||||||
@@ -101,7 +101,7 @@ FILEHANDLE _sys_open(const char *name, int openmode)
|
|||||||
|
|
||||||
fd = open(name, mode, 0);
|
fd = open(name, mode, 0);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return 0; /* error */
|
return -1; /* error */
|
||||||
else
|
else
|
||||||
return fd;
|
return fd;
|
||||||
#endif /* DFS_USING_POSIX */
|
#endif /* DFS_USING_POSIX */
|
||||||
@@ -116,7 +116,7 @@ int _sys_close(FILEHANDLE fh)
|
|||||||
return close(fh);
|
return close(fh);
|
||||||
#else
|
#else
|
||||||
LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS);
|
LOG_W("%s: %s", __func__, _WARNING_WITHOUT_FS);
|
||||||
return 0;
|
return 0; /* error */
|
||||||
#endif /* DFS_USING_POSIX */
|
#endif /* DFS_USING_POSIX */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user