Commit d04b180c authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/vfile: seq_file seek index must progress

Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent 611cb7a0
......@@ -109,11 +109,11 @@ static void *vfile_snapshot_next(struct seq_file *seq, void *v, loff_t *offp)
struct xnvfile_snapshot_iterator *it = seq->private;
loff_t pos = *offp;
++*offp;
if (pos >= it->nrdata)
return NULL;
++*offp;
return it->databuf + pos * it->vfile->datasz;
}
......@@ -453,17 +453,15 @@ static void *vfile_regular_next(struct seq_file *seq, void *v, loff_t *offp)
struct xnvfile_regular *vfile = it->vfile;
void *data;
it->pos = ++(*offp);
if (vfile->ops->next == NULL)
return NULL;
it->pos = *offp + 1;
data = vfile->ops->next(it);
if (data == NULL)
return NULL;
*offp = it->pos;
return data;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment