From fe2d5c83e8254d87ee51a0b68e6f60b4f980747f Mon Sep 17 00:00:00 2001 From: TaeJun Kwon Date: Mon, 3 Apr 2017 17:11:11 +0900 Subject: [PATCH] Fix lseek's bug in smartfs lseek should set the file offset to the size of the file plus offset --- os/fs/smartfs/smartfs_smart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/fs/smartfs/smartfs_smart.c b/os/fs/smartfs/smartfs_smart.c index ca555bd..a42686c 100644 --- a/os/fs/smartfs/smartfs_smart.c +++ b/os/fs/smartfs/smartfs_smart.c @@ -1040,7 +1040,7 @@ static off_t smartfs_seek_internal(struct smartfs_mountpt_s *fs, struct smartfs_ break; case SEEK_END: - newpos = sf->entry.datlen - offset; + newpos = sf->entry.datlen + offset; break; } -- 2.7.4