From d8c659416c232a19a4d373b3b98c13242da4e2e0 Mon Sep 17 00:00:00 2001 From: Alessandro Rubini Date: Thu, 9 Oct 2014 12:22:04 +0200 Subject: [PATCH] sdbfs/lib: fix offset in returned devices when scanning Signed-off-by: Alessandro Rubini --- sdbfs/lib/glue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sdbfs/lib/glue.c b/sdbfs/lib/glue.c index ff06986..e268f8f 100644 --- a/sdbfs/lib/glue.c +++ b/sdbfs/lib/glue.c @@ -157,7 +157,7 @@ scan: if (newdir) { dev = scan_newdir(fs, depth); if (dev) - return dev; + goto out; /* Otherwise the directory is not there: no intercon */ if (!depth) return NULL; /* no entries at all */ @@ -175,6 +175,9 @@ scan: dev = fs->currentp = sdbfs_readentry(fs, fs->this[depth]); fs->this[depth] += sizeof(*dev); fs->nleft[depth]--; +out: + fs->f_offset = fs->base[fs->depth] + + htonll(fs->currentp->sdb_component.addr_first); return dev; } -- 2.18.1