From 2bcb8b7b07ed9c20eab6f6875d720cc2aacdb608 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 13 Mar 2017 07:31:47 -0600 Subject: [PATCH] If whence is SEEK_END, the file offset shall be set to the size of the file plus offset. Noted by eunb.song@samsung.com --- fs/smartfs/smartfs_smart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smartfs/smartfs_smart.c b/fs/smartfs/smartfs_smart.c index 23f36860fe..60a539c10f 100644 --- a/fs/smartfs/smartfs_smart.c +++ b/fs/smartfs/smartfs_smart.c @@ -1044,7 +1044,7 @@ static off_t smartfs_seek_internal(struct smartfs_mountpt_s *fs, break; case SEEK_END: - newpos = sf->entry.datlen - offset; + newpos = sf->entry.datlen + offset; break; }