diff --git a/components/libc/dlib/syscall_close.c b/components/libc/dlib/syscall_close.c index 5792bb3806fd3bb0d1ba8b10f52867f7755b3cad..c2bb0b63d6b84203045953d4da6d2b98aac1402a 100644 --- a/components/libc/dlib/syscall_close.c +++ b/components/libc/dlib/syscall_close.c @@ -36,7 +36,7 @@ int __close(int handle) return _LLIO_ERROR; #ifdef RT_USING_DFS - return close(handle); + return close(handle - _LLIO_STDERR - 1); #else return 0; #endif diff --git a/components/libc/dlib/syscall_lseek.c b/components/libc/dlib/syscall_lseek.c index 950ba52f652a2872758fdb9b9121559365dd926c..23d509817ebdb0a31e7a8bc40f27315985c27ffa 100644 --- a/components/libc/dlib/syscall_lseek.c +++ b/components/libc/dlib/syscall_lseek.c @@ -36,7 +36,7 @@ long __lseek(int handle, long offset, int whence) return _LLIO_ERROR; #ifdef RT_USING_DFS - return lseek(handle, offset, whence); + return lseek(handle - _LLIO_STDERR - 1, offset, whence); #else return _LLIO_ERROR; #endif