From 29411bca714249322b0c2288036db4a7fcd3fe94 Mon Sep 17 00:00:00 2001 From: Roamboy <0yfj0@163.com> Date: Fri, 5 Aug 2016 21:08:30 +0800 Subject: [PATCH] =?UTF-8?q?IAR=E7=BC=96=E8=AF=91=E5=99=A8dlib=20=5F=5Fclos?= =?UTF-8?q?e,=5F=5Flseek=20hanle=E4=BC=A0=E5=85=A5=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/libc/dlib/syscall_close.c | 2 +- components/libc/dlib/syscall_lseek.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/libc/dlib/syscall_close.c b/components/libc/dlib/syscall_close.c index 5792bb3806..c2bb0b63d6 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 950ba52f65..23d509817e 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 -- GitLab