summaryrefslogtreecommitdiffstats
path: root/fs/fs.c
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-01-28 22:55:37 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-29 09:27:03 +0100
commitc44997e621cfe190fe44523e6cbcb03fea21eb8c (patch)
treebfd907f6c2fcd6ee6073f1d48864df6644aa559a /fs/fs.c
parent6811cc0dbc04c71cdc1ff12efe0edc8660200563 (diff)
downloadbarebox-c44997e621cfe190fe44523e6cbcb03fea21eb8c.tar.gz
barebox-c44997e621cfe190fe44523e6cbcb03fea21eb8c.tar.xz
fs: Update FILE position in lseek()
Instead on relying on driver callbacks to update 'pos' in FILE, do it as a part of lseek() code. This allows us to drop a bit of repeating code as well as making lseek() implementation consistent with write() and read(). Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/fs.c')
-rw-r--r--fs/fs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 625ed10b70..bfed252a4b 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -448,6 +448,8 @@ loff_t lseek(int fildes, loff_t offset, int whence)
return -1;
}
+ f->pos = pos;
+
return pos;
out: